pub struct Aside {
pub kind: String,
pub after: Option<MessageId>,
pub author: Author,
pub value: Value,
pub saved: bool,
}Expand description
Kept with the conversation, saved and forked with it, never sent to a model: a plugin’s note in the transcript, the host’s record of a call in flight, a plugin’s own data. Readers take the kinds they know.
Fields§
§kind: StringWhat it is, chosen by its author: "note" (a transcript
Note), "rig.call" (the host’s call-in-flight
record), a plugin’s own kind.
after: Option<MessageId>The entry it follows; None before the first. While an edit took
that entry out it follows start_of
it.
Who put it in.
value: ValueIts data, verbatim.
saved: boolWhether it is saved with the conversation (the default). An unsaved one lives as long as the value: no change records it.
Implementations§
Source§impl Aside
impl Aside
Sourcepub fn new(kind: impl Into<String>, author: Author, value: Value) -> Self
pub fn new(kind: impl Into<String>, author: Author, value: Value) -> Self
A saved aside of kind by author, holding value, before the
first entry.
Sourcepub fn after(self, after: Option<MessageId>) -> Self
pub fn after(self, after: Option<MessageId>) -> Self
This aside, following entry after (None: before the first).
Sourcepub fn read<T: DeserializeOwned>(&self, kind: &str) -> Option<T>
pub fn read<T: DeserializeOwned>(&self, kind: &str) -> Option<T>
The T this aside holds when it is of kind; None for another
kind or a value that is not a T.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Aside
impl<'de> Deserialize<'de> for Aside
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 StructuralPartialEq for Aside
Auto Trait Implementations§
impl Forget for Aside
impl Freeze for Aside
impl Move for Aside
impl RefUnwindSafe for Aside
impl Send for Aside
impl Sync for Aside
impl Unpin for Aside
impl UnsafeUnpin for Aside
impl UnwindSafe for Aside
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>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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