pub struct AttachInput {
pub external_id: String,
}Expand description
The input of episodes.attach: which piece of work this connection is carrying.
The identity is the only field, and an unknown one is refused rather than ignored, so a client that sends a peer id under another name learns it at once:
use majordomus_cli::capability::builtin::episodes::AttachInput;
let input: AttachInput = serde_json::from_str(r#"{"external_id":"conv-42"}"#).unwrap();
assert_eq!(input.external_id, "conv-42");
assert!(serde_json::from_str::<AttachInput>(r#"{"external_id":"x","peer":"p1"}"#).is_err());
assert!(serde_json::from_str::<AttachInput>("{}").is_err(), "the identity is required");Fields§
§external_id: StringThe client’s own durable name for this episode — its conversation id, thread id, or whatever it calls the sitting it is in.
It must survive a reconnect, because that is the whole of its job: a client that comes back under the same identity is given its own episode again rather than a second one. Anything the client can reproduce will do; what will not do is this server’s peer id, which is handed out per connection and is a different string every time the client reconnects.
Trait Implementations§
Source§impl BenchmarkCases for AttachInput
impl BenchmarkCases for AttachInput
Source§fn benchmark_cases(_: &CaseContext<'_>) -> Vec<NamedCase<Self>>
fn benchmark_cases(_: &CaseContext<'_>) -> Vec<NamedCase<Self>>
The cases, in a stable order. An empty list means “nothing to benchmark in this
repository”, which the coverage check reports as missing.
Source§fn benchmark_cases_json(ctx: &CaseContext<'_>) -> Vec<NamedCase<Value>>
fn benchmark_cases_json(ctx: &CaseContext<'_>) -> Vec<NamedCase<Value>>
The cases as JSON, the shape every runner serialises from.
Source§impl Debug for AttachInput
impl Debug for AttachInput
Source§impl<'de> Deserialize<'de> for AttachInput
impl<'de> Deserialize<'de> for AttachInput
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 AttachInput
impl JsonSchema for AttachInput
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 AttachInput
impl RefUnwindSafe for AttachInput
impl Send for AttachInput
impl Sync for AttachInput
impl Unpin for AttachInput
impl UnsafeUnpin for AttachInput
impl UnwindSafe for AttachInput
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