pub enum Scope {
Riff,
Repository(ThreadName),
Other,
}Expand description
What a pause stops: the whole riff, or one repository (01M3XAHZG26ECNARX35JD73YXJ).
| Scope | JSON |
|---|---|
| the whole riff | "riff" |
| a repository | {"repository":"como-technologies/strata"} |
The set of scopes can grow. A build reads a scope that it does not
know as Scope::Other, and such a record changes no pause.
use riff_core::record::Scope;
let read = |json: &str| serde_json::from_str::<Scope>(json).unwrap();
assert_eq!(read(r#""riff""#), Scope::Riff);
assert_eq!(read(r#"{"repository":"acme/app"}"#), Scope::Repository("acme/app".parse()?));
// A scope of a later build.
assert_eq!(read(r#"{"wave":"17"}"#), Scope::Other);
assert_eq!(read(r#""host""#), Scope::Other);
assert_eq!(Scope::Riff.to_string(), "the riff");
assert_eq!(read(r#"{"repository":"acme/app"}"#).to_string(), "the repository acme/app");Variants§
Riff
The whole riff.
Repository(ThreadName)
One repository, by its thread.
Other
A scope that this build does not know.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scope
impl<'de> Deserialize<'de> for Scope
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Scope, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Scope, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Scope
The schema takes each value: Scope reads a scope that it does
not know as Scope::Other.
impl JsonSchema for Scope
The schema takes each value: Scope reads a scope that it does
not know as Scope::Other.
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl Eq for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.