Struct activitypub_federation::axum::json::FederationJson
source · pub struct FederationJson<Json: Serialize>(pub Json);
Expand description
Wrapper struct to respond with application/activity+json
in axum handlers
Tuple Fields§
§0: Json
Trait Implementations§
source§impl<Json: Clone + Serialize> Clone for FederationJson<Json>
impl<Json: Clone + Serialize> Clone for FederationJson<Json>
source§fn clone(&self) -> FederationJson<Json>
fn clone(&self) -> FederationJson<Json>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Json: Default + Serialize> Default for FederationJson<Json>
impl<Json: Default + Serialize> Default for FederationJson<Json>
source§fn default() -> FederationJson<Json>
fn default() -> FederationJson<Json>
Returns the “default value” for a type. Read more
source§impl<Json: Serialize> IntoResponse for FederationJson<Json>
impl<Json: Serialize> IntoResponse for FederationJson<Json>
source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
impl<Json: Copy + Serialize> Copy for FederationJson<Json>
Auto Trait Implementations§
impl<Json> Freeze for FederationJson<Json>where
Json: Freeze,
impl<Json> RefUnwindSafe for FederationJson<Json>where
Json: RefUnwindSafe,
impl<Json> Send for FederationJson<Json>where
Json: Send,
impl<Json> Sync for FederationJson<Json>where
Json: Sync,
impl<Json> Unpin for FederationJson<Json>where
Json: Unpin,
impl<Json> UnwindSafe for FederationJson<Json>where
Json: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T, S, B> Handler<IntoResponseHandler, S, B> for T
impl<T, S, B> Handler<IntoResponseHandler, S, B> for T
source§type Future = Ready<Response<UnsyncBoxBody<Bytes, Error>>>
type Future = Ready<Response<UnsyncBoxBody<Bytes, Error>>>
The type of future calling this handler returns.
source§fn call(
self,
_req: Request<B>,
_state: S,
) -> <T as Handler<IntoResponseHandler, S, B>>::Future
fn call( self, _req: Request<B>, _state: S, ) -> <T as Handler<IntoResponseHandler, S, B>>::Future
Call the handler with the given request.
source§fn layer<L, NewReqBody>(self, layer: L) -> Layered<L, Self, T, S, B, NewReqBody>where
L: Layer<HandlerService<Self, T, S, B>> + Clone,
<L as Layer<HandlerService<Self, T, S, B>>>::Service: Service<Request<NewReqBody>>,
fn layer<L, NewReqBody>(self, layer: L) -> Layered<L, Self, T, S, B, NewReqBody>where
L: Layer<HandlerService<Self, T, S, B>> + Clone,
<L as Layer<HandlerService<Self, T, S, B>>>::Service: Service<Request<NewReqBody>>,
Apply a
tower::Layer
to the handler. Read moresource§fn with_state(self, state: S) -> HandlerService<Self, T, S, B>
fn with_state(self, state: S) -> HandlerService<Self, T, S, B>
Convert the handler into a
Service
by providing the statesource§impl<H, T, B> HandlerWithoutStateExt<T, B> for H
impl<H, T, B> HandlerWithoutStateExt<T, B> for H
source§fn into_service(self) -> HandlerService<H, T, (), B>
fn into_service(self) -> HandlerService<H, T, (), B>
Convert the handler into a
Service
and no state.source§fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, (), B>>
fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, (), B>>
Convert the handler into a
MakeService
and no state. Read moresource§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