Struct activitypub_federation::fetch::collection_id::CollectionId
source · pub struct CollectionId<Kind>(/* private fields */)
where
Kind: Collection,
for<'de2> <Kind as Collection>::Kind: Deserialize<'de2>;
Expand description
Typed wrapper for Activitypub Collection ID which helps with dereferencing.
Implementations§
source§impl<Kind> CollectionId<Kind>
impl<Kind> CollectionId<Kind>
sourcepub fn parse(url: &str) -> Result<Self, ParseError>
pub fn parse(url: &str) -> Result<Self, ParseError>
Construct a new CollectionId instance
sourcepub async fn dereference(
&self,
owner: &<Kind as Collection>::Owner,
data: &Data<<Kind as Collection>::DataType>
) -> Result<Kind, <Kind as Collection>::Error>
pub async fn dereference( &self, owner: &<Kind as Collection>::Owner, data: &Data<<Kind as Collection>::DataType> ) -> Result<Kind, <Kind as Collection>::Error>
Fetches collection over HTTP
Unlike ObjectId::dereference this method doesn’t do any caching.
Trait Implementations§
source§impl<Kind> Clone for CollectionId<Kind>
impl<Kind> Clone for CollectionId<Kind>
Need to implement clone manually, to avoid requiring Kind to be Clone
source§impl<Kind> Debug for CollectionId<Kind>
impl<Kind> Debug for CollectionId<Kind>
source§impl<'de, Kind> Deserialize<'de> for CollectionId<Kind>
impl<'de, Kind> Deserialize<'de> for CollectionId<Kind>
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<Kind> Display for CollectionId<Kind>
impl<Kind> Display for CollectionId<Kind>
source§impl<Kind> From<CollectionId<Kind>> for Url
impl<Kind> From<CollectionId<Kind>> for Url
source§fn from(id: CollectionId<Kind>) -> Self
fn from(id: CollectionId<Kind>) -> Self
Converts to this type from the input type.
source§impl<Kind> From<Url> for CollectionId<Kind>
impl<Kind> From<Url> for CollectionId<Kind>
source§impl<Kind> PartialEq for CollectionId<Kind>
impl<Kind> PartialEq for CollectionId<Kind>
source§impl<Kind> Serialize for CollectionId<Kind>
impl<Kind> Serialize for CollectionId<Kind>
Auto Trait Implementations§
impl<Kind> Freeze for CollectionId<Kind>
impl<Kind> RefUnwindSafe for CollectionId<Kind>
impl<Kind> Send for CollectionId<Kind>
impl<Kind> Sync for CollectionId<Kind>
impl<Kind> Unpin for CollectionId<Kind>
impl<Kind> UnwindSafe for CollectionId<Kind>
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
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>
Converts
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>
Converts
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