pub struct RiffReply {
pub state: RiffState,
pub changed: bool,
pub riff: Option<PauseInfo>,
pub repositories: Vec<RepositoryPause>,
}Expand description
The pauses of the riff, as the caller sees them
(01M3XAHZJAF6YVDJ7WX74X8RBX): the reply to /v1/riff, /v1/pause
and /v1/resume.
use riff_core::wire::{RiffReply, RiffState};
// The reply of a server from before the pause of a repository.
let old: RiffReply = serde_json::from_str(r#"{"state":"paused"}"#).unwrap();
assert_eq!(old.state, RiffState::Paused);
assert!(old.riff.is_none() && old.repositories.is_empty());Fields§
§state: RiffStateThe state for the place of the caller: paused when the whole riff is paused, or when the repository of the caller is paused.
changed: boolTrue when the call changed a pause.
riff: Option<PauseInfo>The pause of the whole riff. None when the riff runs.
repositories: Vec<RepositoryPause>Each repository that is paused, in the order of the names.
Implementations§
Source§impl RiffReply
impl RiffReply
Sourcepub fn repository(&self, thread: &ThreadName) -> Option<&PauseInfo>
pub fn repository(&self, thread: &ThreadName) -> Option<&PauseInfo>
The pause of the repository thread, when it is paused.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RiffReply
impl<'de> Deserialize<'de> for RiffReply
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<RiffState> for RiffReply
The pauses of a riff with no pause of a repository: paused is a
pause of the whole riff that no caller set.
impl From<RiffState> for RiffReply
The pauses of a riff with no pause of a repository: paused is a
pause of the whole riff that no caller set.
use riff_core::wire::{RiffReply, RiffState};
let paused = RiffReply::from(RiffState::Paused);
assert!(paused.riff.is_some());
assert!(RiffReply::from(RiffState::Running).riff.is_none());Source§impl JsonSchema for RiffReply
impl JsonSchema for RiffReply
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§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 RiffReply
impl StructuralPartialEq for RiffReply
Auto Trait Implementations§
impl Freeze for RiffReply
impl RefUnwindSafe for RiffReply
impl Send for RiffReply
impl Sync for RiffReply
impl Unpin for RiffReply
impl UnsafeUnpin for RiffReply
impl UnwindSafe for RiffReply
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.