pub struct LabelTerm {
pub namespace: String,
pub value: String,
}Expand description
One namespace/value pair, the elemental unit of NIP-32.
namespace is the L tag value (or UGC_NAMESPACE when the
label tag had no mark). value is the l tag’s first column.
Fields§
§namespace: StringL namespace. Always non-empty when surfaced from
Label::from_event / labels_from_tags.
value: Stringl value.
Implementations§
Source§impl LabelTerm
impl LabelTerm
Sourcepub fn new(namespace: impl Into<String>, value: impl Into<String>) -> Self
pub fn new(namespace: impl Into<String>, value: impl Into<String>) -> Self
Construct a term in namespace with value.
Sourcepub fn ugc(value: impl Into<String>) -> Self
pub fn ugc(value: impl Into<String>) -> Self
Convenience constructor for the spec’s reserved
UGC_NAMESPACE.
Sourcepub fn is_ugc(&self) -> bool
pub fn is_ugc(&self) -> bool
True if this term lives in the reserved UGC_NAMESPACE.
Trait Implementations§
impl Eq for LabelTerm
impl StructuralPartialEq for LabelTerm
Auto Trait Implementations§
impl Freeze for LabelTerm
impl RefUnwindSafe for LabelTerm
impl Send for LabelTerm
impl Sync for LabelTerm
impl Unpin for LabelTerm
impl UnsafeUnpin for LabelTerm
impl UnwindSafe for LabelTerm
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.