Struct activitypub_federation::protocol::context::WithContext
source · pub struct WithContext<T> { /* private fields */ }
Expand description
Wrapper for federated structs which handles @context
field.
Implementations§
source§impl<T> WithContext<T>
impl<T> WithContext<T>
sourcepub fn new_default(inner: T) -> WithContext<T>
pub fn new_default(inner: T) -> WithContext<T>
Create a new wrapper with the default Activitypub context.
sourcepub fn new(inner: T, context: Value) -> WithContext<T>
pub fn new(inner: T, context: Value) -> WithContext<T>
Create new wrapper with custom context. Use this in case you are implementing extensions.
Trait Implementations§
source§impl<T> ActivityHandler for WithContext<T>
impl<T> ActivityHandler for WithContext<T>
§type DataType = <T as ActivityHandler>::DataType
type DataType = <T as ActivityHandler>::DataType
App data type passed to handlers. Must be identical to
crate::config::FederationConfigBuilder::app_data type.
§type Error = <T as ActivityHandler>::Error
type Error = <T as ActivityHandler>::Error
Error type returned by handler methods
source§fn verify<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 Data<Self::DataType>
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn verify<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 Data<Self::DataType>
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Verifies that the received activity is valid. Read more
source§impl<T> Clone for WithContext<T>where
T: Clone,
impl<T> Clone for WithContext<T>where
T: Clone,
source§impl<T: Debug> Debug for WithContext<T>
impl<T: Debug> Debug for WithContext<T>
source§impl<'de, T> Deserialize<'de> for WithContext<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for WithContext<T>where
T: Deserialize<'de>,
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
Auto Trait Implementations§
impl<T> Freeze for WithContext<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithContext<T>where
T: RefUnwindSafe,
impl<T> Send for WithContext<T>where
T: Send,
impl<T> Sync for WithContext<T>where
T: Sync,
impl<T> Unpin for WithContext<T>where
T: Unpin,
impl<T> UnwindSafe for WithContext<T>where
T: UnwindSafe,
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