Struct lemmy_apub_lib::object_id::ObjectId [−][src]
pub struct ObjectId<Kind>(_, _)
where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>;
Expand description
We store Url on the heap because it is quite large (88 bytes).
Implementations
impl<Kind> ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind> ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
pub async fn dereference(
&self,
data: &<Kind as ApubObject>::DataType,
request_counter: &mut i32
) -> Result<Kind, LemmyError>
pub async fn dereference(
&self,
data: &<Kind as ApubObject>::DataType,
request_counter: &mut i32
) -> Result<Kind, LemmyError>
Fetches an activitypub object, either from local database (if possible), or over http.
pub async fn dereference_local(
&self,
data: &<Kind as ApubObject>::DataType
) -> Result<Kind, LemmyError>
pub async fn dereference_local(
&self,
data: &<Kind as ApubObject>::DataType
) -> Result<Kind, LemmyError>
Fetch an object from the local db. Instead of falling back to http, this throws an error if the object is not found in the database.
Trait Implementations
impl<Kind: Clone> Clone for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind: Clone> Clone for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind: Debug> Debug for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind: Debug> Debug for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<'de, Kind> Deserialize<'de> for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<'de, Kind> Deserialize<'de> for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
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
impl<Kind> Display for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind> Display for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind> From<ObjectId<Kind>> for Url where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind> From<ObjectId<Kind>> for Url where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind: PartialEq> PartialEq<ObjectId<Kind>> for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind: PartialEq> PartialEq<ObjectId<Kind>> for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind> Serialize for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind> Serialize for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
impl<Kind> StructuralPartialEq for ObjectId<Kind> where
Kind: ApubObject + Send + 'static,
for<'de2> <Kind as ApubObject>::ApubType: Deserialize<'de2>,
Auto Trait Implementations
impl<Kind> RefUnwindSafe for ObjectId<Kind> where
Kind: RefUnwindSafe,
impl<Kind> UnwindSafe for ObjectId<Kind> where
Kind: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Convert self
to an expression for Diesel’s query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel’s query builder. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more