pub struct Message {
pub v: u8,
pub id: String,
pub kind: Kind,
pub by: String,
pub name: String,
pub harness: String,
pub node: String,
pub to: String,
pub re: Option<String>,
pub ms: i64,
pub text: String,
}Expand description
One message of messages.jsonl.
Fields§
§v: u8The line format: 1 for a text that fits V1_TEXT, 2 for a longer one (clean). Not hashed.
id: String“m” + 12 hex of blake3 over every other field but v (id_of).
kind: Kind§by: StringThe sending session, or engineer[:<email>] from a terminal.
name: StringThe sender as a label names it: its designation when sent, or the engineer’s email.
harness: StringThe sender’s harness, terminal for the engineer.
node: StringThe sender’s node (node): the one field the mesh checks.
to: StringAn Address: all (the collective), local@<node>, <session>@<node>, or engineer[:<email>].
re: Option<String>The message this one answers.
ms: i64§text: StringImplementations§
Source§impl Message
impl Message
pub fn new( kind: Kind, from: &Sender, to: &str, re: Option<&str>, ms: i64, text: &str, ) -> Message
pub fn asks(&self) -> bool
Sourcepub fn stays_here(&self) -> bool
pub fn stays_here(&self) -> bool
Whether it is for the sessions of its own node only (local): it never travels to another
member (borg-mesh lines.rs travels).
Sourcepub fn well_formed(&self) -> bool
pub fn well_formed(&self) -> bool
Whether the line is one new could have written: its id is the hash of its fields, its names are
tokens, its label and text are as new cleans them, re is a message id, its kind may go where
it goes (Kind::may_address), a local@<node> names its own node (its to is a claim, its node
is checked: no node broadcasts into another’s sessions), and only a pause or resume goes without
a text. A v1 line’s text is as 0.5.0 cut it (cut_v1, so its lines still read); a v2 line’s is
longer than V1_TEXT and whole up to WIRE_TEXT (clean).
Who sent it, as the line names it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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 Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.