pub struct Annotation { /* private fields */ }Expand description
A token’s or perp’s annotation: a category, a description, a display name
frontends show instead of the listed name (None to keep the listed
name) and up to two keywords searches match against.
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn new(
category: impl Into<String>,
description: impl Into<String>,
display_name: Option<String>,
keywords: Vec<String>,
) -> Result<Self, BadDeploy>
pub fn new( category: impl Into<String>, description: impl Into<String>, display_name: Option<String>, keywords: Vec<String>, ) -> Result<Self, BadDeploy>
Refuses a category over 15 characters, a description over 400, a display name over 9, more than 2 keywords or a keyword over 10.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
The description, at most 400 characters.
Sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
The name frontends show instead of the listed name; None keeps the listed name.
Sourcepub fn keywords(&self) -> &[String]
pub fn keywords(&self) -> &[String]
Up to two words searches match against, each at most 10 characters.
Sourcepub fn wire_after(&self, map: Map) -> Map
pub fn wire_after(&self, map: Map) -> Map
{"category","description","displayName","keywords"} after the keys
already in map; a missing display name is sent as null.
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§impl Debug for Annotation
impl Debug for Annotation
impl Eq for Annotation
Source§impl PartialEq for Annotation
impl PartialEq for Annotation
impl StructuralPartialEq for Annotation
Auto Trait Implementations§
impl Forget for Annotation
impl Freeze for Annotation
impl Move for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnsafeUnpin for Annotation
impl UnwindSafe for Annotation
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
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,
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
Compare self to
key and return true if they are equal.