pub struct MessageOrigin {
pub kind: TriggerKind,
pub from: Option<String>,
pub trust: Option<OriginTrust>,
pub tier: Option<OriginTier>,
pub delivery: Option<OriginDelivery>,
pub sig: Option<OriginSig>,
pub msg_id: Option<String>,
pub sent_ms: Option<i64>,
pub delivered_ms: Option<i64>,
pub held_for_s: Option<u64>,
}Expand description
Who or what a message is from, set by srv from typed values.
Fields§
§kind: TriggerKindThe display kind; the same enum the working row’s turn trigger uses.
from: Option<String>The sender: the agent, cron, github-consumer; absent for the human.
trust: Option<OriginTrust>§tier: Option<OriginTier>§delivery: Option<OriginDelivery>§sig: Option<OriginSig>§msg_id: Option<String>The jekt’s MSGID.
sent_ms: Option<i64>When the sender sent it (unix ms).
delivered_ms: Option<i64>When srv delivered it (unix ms); far from sent_ms means a late delivery.
held_for_s: Option<u64>Seconds a held message waited before it was replayed.
Implementations§
Source§impl MessageOrigin
impl MessageOrigin
Sourcepub fn of(kind: TriggerKind) -> Self
pub fn of(kind: TriggerKind) -> Self
A message of kind and nothing else known about it.
Sourcepub fn supervisor() -> Self
pub fn supervisor() -> Self
The Swarm Supervisor’s continuation.
Sourcepub fn from_sender(from: &str) -> Self
pub fn from_sender(from: &str) -> Self
A message from sent, with the kind its name implies: cron and
loop are schedules, *-consumer services, anything else an agent.
The name is srv’s own record of the sender (the request’s
source_agent), not text read from a body.
Sourcepub fn as_model_text<'a>(&self, text: &'a str) -> Cow<'a, str>
pub fn as_model_text<'a>(&self, text: &'a str) -> Cow<'a, str>
text as the model receives it: the person’s own words carry the mark only srv writes
(sanitize::user_turn_message); every other origin’s text goes as it is, with its own
marker already in it. The stored record drops the mark again (RecordOrigin::stamp).
Sourcepub fn turn_origin(&self) -> TurnOrigin
pub fn turn_origin(&self) -> TurnOrigin
The security class of the turn this message starts: the human (and
their Swarm broadcast) is User, AgentMux’s own input is System,
everything else is Automated. Derived here so the two cannot drift.
Sourcepub fn from_composer(origin: TurnOrigin) -> Self
pub fn from_composer(origin: TurnOrigin) -> Self
The origin of a composer message: origin is what the route proved
about the caller (composer_origin), never the request’s word.
Trait Implementations§
Source§impl Clone for MessageOrigin
impl Clone for MessageOrigin
Source§fn clone(&self) -> MessageOrigin
fn clone(&self) -> MessageOrigin
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 MessageOrigin
impl Debug for MessageOrigin
Source§impl<'de> Deserialize<'de> for MessageOrigin
impl<'de> Deserialize<'de> for MessageOrigin
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 MessageOrigin
Source§impl PartialEq for MessageOrigin
impl PartialEq for MessageOrigin
Source§impl Serialize for MessageOrigin
impl Serialize for MessageOrigin
impl StructuralPartialEq for MessageOrigin
Source§impl TS for MessageOrigin
impl TS for MessageOrigin
Source§type WithoutGenerics = MessageOrigin
type WithoutGenerics = MessageOrigin
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = MessageOrigin
type OptionInnerType = MessageOrigin
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all]. Read more§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export]. Read moreAuto Trait Implementations§
impl Freeze for MessageOrigin
impl RefUnwindSafe for MessageOrigin
impl Send for MessageOrigin
impl Sync for MessageOrigin
impl Unpin for MessageOrigin
impl UnsafeUnpin for MessageOrigin
impl UnwindSafe for MessageOrigin
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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
§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.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more