pub struct ConnectionEpisode {
pub external_id: String,
pub provider: String,
pub peer: Option<PeerId>,
pub opened_at: String,
pub last_activity_seconds_ago: u64,
pub attachments: u32,
pub state: ConnectionEpisodeState,
pub repository: String,
}Expand description
One episode: what the client calls itself, which connection holds it now, and what the repository did about it.
use majordomus_cli::episodes::{ConnectionEpisode, EpisodeBoard};
use majordomus_cli::peers::{PeerBoard, Transport};
let peer = PeerBoard::new().attach(Transport::Http);
let (episode, _) = EpisodeBoard::new().attach(&peer, "conv-42", "generic");
let episode: ConnectionEpisode = episode;
assert_eq!((episode.external_id.as_str(), episode.provider.as_str()), ("conv-42", "generic"));
assert_eq!(episode.peer.as_ref(), Some(&peer));
// never empty: a board with no repository behind it says so
assert!(episode.repository.contains("without a driver"));Fields§
§external_id: StringThe client’s own durable name for this piece of work, and the key everything here is addressed by. Never a peer id: see the module documentation.
provider: StringThe provider id this episode is recorded under, as share/providers.yaml names one.
peer: Option<PeerId>The connection holding it, when one does. None while detached — which is a state
an episode is supposed to reach and come back from, not a fault.
opened_at: StringWhen it was first opened, RFC 3339, UTC. Unchanged by a re-attach: the episode is the work, and the work did not restart because a socket did.
last_activity_seconds_ago: u64Seconds since the client last spoke on it, through any connection.
attachments: u32How many times a connection has taken it over, the first attach included.
state: ConnectionEpisodeStateOpen, or detached and waiting for its client.
repository: StringWhat the repository’s own episode command reported, verbatim — the record it opened, or the reason it could not. Never interpreted here, and never empty: a subsystem that silently does nothing is the failure mode this field exists to make visible.
Trait Implementations§
Source§impl Clone for ConnectionEpisode
impl Clone for ConnectionEpisode
Source§fn clone(&self) -> ConnectionEpisode
fn clone(&self) -> ConnectionEpisode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectionEpisode
impl Debug for ConnectionEpisode
Source§impl<'de> Deserialize<'de> for ConnectionEpisode
impl<'de> Deserialize<'de> for ConnectionEpisode
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>,
impl Eq for ConnectionEpisode
Source§impl JsonSchema for ConnectionEpisode
impl JsonSchema for ConnectionEpisode
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ConnectionEpisode
impl PartialEq for ConnectionEpisode
Source§fn eq(&self, other: &ConnectionEpisode) -> bool
fn eq(&self, other: &ConnectionEpisode) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ConnectionEpisode
impl Serialize for ConnectionEpisode
impl StructuralPartialEq for ConnectionEpisode
Auto Trait Implementations§
impl Freeze for ConnectionEpisode
impl RefUnwindSafe for ConnectionEpisode
impl Send for ConnectionEpisode
impl Sync for ConnectionEpisode
impl Unpin for ConnectionEpisode
impl UnsafeUnpin for ConnectionEpisode
impl UnwindSafe for ConnectionEpisode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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
key and return true if they are equal.