Struct Response
#[non_exhaustive]pub struct Response {
pub event_or_content: Box<RawValue>,
}Expand description
Response type for the get_state_events_for_key endpoint, either the Raw AnyStateEvent
or AnyStateEventContent.
While it’s possible to access the raw value directly, it’s recommended you use the
provided helper methods to access it, and From to create it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.event_or_content: Box<RawValue>The full event (content) of the state event.
Implementations§
§impl Response
impl Response
pub fn new(event_or_content: Box<RawValue>) -> Response
pub fn new(event_or_content: Box<RawValue>) -> Response
Creates a new Response with the given event (content).
pub fn into_event(self) -> Raw<AnyStateEvent>
pub fn into_event(self) -> Raw<AnyStateEvent>
Returns an unchecked Raw<AnyStateEvent>.
This method should only be used if you specified the format in the request to be
StateEventFormat::Event
pub fn into_content(self) -> Raw<AnyStateEventContent>
pub fn into_content(self) -> Raw<AnyStateEventContent>
Returns an unchecked Raw<AnyStateEventContent>.
This method should only be used if you did not specify the format in the request, or
set it to be StateEventFormat::Content
Since the inner type of the Raw does not implement Deserialize, you need to use
.deserialize_as_unchecked::<T>() or
.cast_ref_unchecked::<T>().deserialize_with_type() to deserialize it.
Trait Implementations§
§impl From<Raw<AnyStateEvent>> for Response
impl From<Raw<AnyStateEvent>> for Response
§fn from(value: Raw<AnyStateEvent>) -> Response
fn from(value: Raw<AnyStateEvent>) -> Response
§impl From<Raw<AnyStateEventContent>> for Response
impl From<Raw<AnyStateEventContent>> for Response
§fn from(value: Raw<AnyStateEventContent>) -> Response
fn from(value: Raw<AnyStateEventContent>) -> Response
§impl IncomingResponse for Response
impl IncomingResponse for Response
§type EndpointError = Error
type EndpointError = Error
§fn try_from_http_response<T>(
response: Response<T>,
) -> Result<Response, FromHttpResponseError<Error>>
fn try_from_http_response<T>( response: Response<T>, ) -> Result<Response, FromHttpResponseError<Error>>
http::Response into this response type.§impl OutgoingResponse for Response
impl OutgoingResponse for Response
§fn try_into_http_response<T>(self) -> Result<Response<T>, IntoHttpError>
fn try_into_http_response<T>(self) -> Result<Response<T>, IntoHttpError>
http::Response. Read moreAuto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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