packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug
OpenID Connect login application · Dependency source and specification
This is the exact dependency version used by this example.
Code
// Generated by aug spec. This is a copy of the installed dependency source.
/** An explicit clock dependency makes time-based behavior replaceable in tests. */
capability Clock:
/** Read whole Unix seconds in UTC. */
now() returns int uses Clock.now unless TimeError
extern C value _aug_time_now() returns int uses Clock.now unless TimeError
/** Operating-system wall clock. */
SystemClock() implements Clock:
now() returns int unless TimeError:
unsafe:
return _aug_time_now()// Generated by aug spec. This is a copy of the installed dependency source.
/** An explicit clock dependency makes time-based behavior replaceable in tests. */
capability Clock {
/** Read whole Unix seconds in UTC. */
now() returns int uses Clock.now unless TimeError
}
extern C value _aug_time_now() returns int uses Clock.now unless TimeError
/** Operating-system wall clock. */
SystemClock() implements Clock {
now() returns int unless TimeError {
unsafe {
return _aug_time_now()
}
}
}Compiled specification
Clock · capability interface · source
An explicit clock dependency makes time-based behavior replaceable in tests.
Clock.now · source
Read whole Unix seconds in UTC. It returns int. It can call Clock.now. Failures can raise TimeError.
SystemClock · class · source
Operating-system wall clock. It implements Clock.
SystemClock.now · source
Read whole Unix seconds in UTC. It can call Clock.now. Failures can raise TimeError.
Within an unsafe block, it returns _aug_time_now. Native operations must satisfy their declared C contracts. source
Checked interface
now() returns int unless TimeError uses Clock.nowIt can call Clock.now. Failures can raise TimeError.
_aug_time_now · source
It is private to its defining scope. It returns int. It can call Clock.now. Failures can raise TimeError.
Native C implementation; only its declared contract is visible here.