pub struct Described {
pub what: Did,
pub item: Option<ActionItem>,
}Expand description
What an action says about itself before it applies: what it does and to
which item (crate::Action::describe).
Fields§
§what: Did§item: Option<ActionItem>Implementations§
Source§impl Described
impl Described
pub fn new(what: Did) -> Self
Sourcepub fn on(self, id: impl Into<String>, label: impl Into<String>) -> Self
pub fn on(self, id: impl Into<String>, label: impl Into<String>) -> Self
About the item id, named by label as one line people read
(one_line, at most
MAX_LABEL_CHARS characters): an
entry names its item, it never carries what the item reads. A message
is labelled by its text, so a label kept whole put the whole reply so
far into every change that grew it. An item with no name of its own
is called by its id, which stays whole: a reader takes a label that
repeats the id for no name.
Only an entry being written passes here. A kept entry is read back as
it was written, so a change from before this rule keeps its bytes, and
is verified and undone under them (crate::verify_change).
Sourcepub fn of_published(encoded: &EncodedAction, key: ActionKey) -> Option<Self>
pub fn of_published(encoded: &EncodedAction, key: ActionKey) -> Option<Self>
The published action key invoked with encoded: the verb with the
plain arguments the encoded value carries. An empty key.app is
filled by the executor from the entry’s app.
Sourcepub fn from_encoded(encoded: &EncodedAction, app: Option<&str>) -> Option<Self>
pub fn from_encoded(encoded: &EncodedAction, app: Option<&str>) -> Option<Self>
What an encoded action says about itself when its type describes
nothing: the verb its serde variant names, with its plain arguments.
app names the publishing app; without one the action type’s stem
(notes of notes.action) stands in.
Sourcepub fn from_value(
type_id: &str,
value: &Value,
app: Option<&str>,
) -> Option<Self>
pub fn from_value( type_id: &str, value: &Value, app: Option<&str>, ) -> Option<Self>
Self::from_encoded for an action value already in JSON.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Described
impl<'de> Deserialize<'de> for Described
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 Described
impl StructuralPartialEq for Described
Auto Trait Implementations§
impl Forget for Described
impl Freeze for Described
impl Move for Described
impl RefUnwindSafe for Described
impl Send for Described
impl Sync for Described
impl Unpin for Described
impl UnsafeUnpin for Described
impl UnwindSafe for Described
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<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