pub struct Attached {
pub episode: ConnectionEpisode,
pub resumed: bool,
pub reattach_grace_seconds: u64,
}Expand description
The answer of episodes.attach: the episode the connection now holds, whether it was
resumed rather than opened, and how long it outlives a lost connection.
use majordomus_cli::capability::builtin::episodes::Attached;
let schema = serde_json::to_value(schemars::schema_for!(Attached)).unwrap();
for field in ["episode", "resumed", "reattach_grace_seconds"] {
assert!(schema["required"].as_array().unwrap().iter().any(|f| f == field), "{field}");
}Fields§
§episode: ConnectionEpisodeThe episode this connection now holds.
resumed: boolWhether an episode already under this identity was resumed rather than a new one opened. True after a reconnect, a client restart or a crash, and the field a caller checks to know whether it is continuing something.
reattach_grace_seconds: u64How long this episode survives its connection before the reaper closes it, in seconds. Stated rather than left to be discovered: a client that knows the grace can decide whether reconnecting is worth it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Attached
impl<'de> Deserialize<'de> for Attached
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 JsonSchema for Attached
impl JsonSchema for Attached
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 moreAuto Trait Implementations§
impl Freeze for Attached
impl RefUnwindSafe for Attached
impl Send for Attached
impl Sync for Attached
impl Unpin for Attached
impl UnsafeUnpin for Attached
impl UnwindSafe for Attached
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