Enum notedealer::activitypub::ObjectsOrLinks
source · [−]pub enum ObjectsOrLinks<'a> {
Single(ObjectOrLink<'a>),
Multiple(Vec<ObjectOrLink<'a>>),
}Expand description
One or more ObjectOrLinks.
Variants
Single(ObjectOrLink<'a>)
Multiple(Vec<ObjectOrLink<'a>>)
Implementations
sourceimpl<'a> ObjectsOrLinks<'a>
impl<'a> ObjectsOrLinks<'a>
sourcepub fn link(link: Cow<'_, str>) -> ObjectsOrLinks<'_>
pub fn link(link: Cow<'_, str>) -> ObjectsOrLinks<'_>
Makes an ObjectOrLinks::Single that contains the given Link.
sourcepub fn has_id(&self, id: &str) -> bool
pub fn has_id(&self, id: &str) -> bool
Returns true if this either represents an Object with the given id, or contains an Object that has the given id.
sourcepub fn compact(&mut self)
pub fn compact(&mut self)
Recursively calls ObjectOrLink::compact for all the inner values of
this object.
sourcepub fn for_links<F: FnMut(&Cow<'a, str>)>(&self, f: F)
pub fn for_links<F: FnMut(&Cow<'a, str>)>(&self, f: F)
Recursively runs the given function f for each Link contained in
this.
sourcepub fn for_objects_or_links_mut<F: FnMut(&mut ObjectOrLink<'_>)>(&mut self, f: F)
pub fn for_objects_or_links_mut<F: FnMut(&mut ObjectOrLink<'_>)>(&mut self, f: F)
Recursively runs the given function f for each Link contained in
this, with mutable access to the specific ObjectOrLink.
Trait Implementations
sourceimpl<'a> Clone for ObjectsOrLinks<'a>
impl<'a> Clone for ObjectsOrLinks<'a>
sourcefn clone(&self) -> ObjectsOrLinks<'a>
fn clone(&self) -> ObjectsOrLinks<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl<'a> Debug for ObjectsOrLinks<'a>
impl<'a> Debug for ObjectsOrLinks<'a>
sourceimpl<'de, 'a> Deserialize<'de> for ObjectsOrLinks<'a>
impl<'de, 'a> Deserialize<'de> for ObjectsOrLinks<'a>
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'a> Serialize for ObjectsOrLinks<'a>
impl<'a> Serialize for ObjectsOrLinks<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for ObjectsOrLinks<'a>
impl<'a> Send for ObjectsOrLinks<'a>
impl<'a> Sync for ObjectsOrLinks<'a>
impl<'a> Unpin for ObjectsOrLinks<'a>
impl<'a> UnwindSafe for ObjectsOrLinks<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more