Struct Request
#[non_exhaustive]pub struct Request {
pub user_id: OwnedUserId,
pub avatar_url: Option<OwnedMxcUri>,
pub blurhash: Option<String>,
}Expand description
Request type for the set_avatar_url endpoint.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.user_id: OwnedUserIdThe user whose avatar URL will be set.
avatar_url: Option<OwnedMxcUri>The new avatar URL for the user.
None is used to unset the avatar.
If you activate the compat-empty-string-null feature, this field being an empty
string in JSON will result in None here during deserialization.
If you active the compat-unset-avatar feature, this field being None will result
in an empty string in serialization, which is the same thing Element Web does (c.f.
https://github.com/matrix-org/matrix-spec/issues/378#issuecomment-1055831264).
blurhash: Option<String>Implementations§
§impl Request
impl Request
pub fn new(user_id: OwnedUserId, avatar_url: Option<OwnedMxcUri>) -> Request
👎Deprecated: Use the set_profile_field endpoint instead.
pub fn new(user_id: OwnedUserId, avatar_url: Option<OwnedMxcUri>) -> Request
Creates a new Request with the given user ID and avatar URL.
Trait Implementations§
§impl IncomingRequest for Request
impl IncomingRequest for Request
§type EndpointError = Error
type EndpointError = Error
A type capturing the error conditions that can be returned in the response.
§type OutgoingResponse = Response
type OutgoingResponse = Response
Response type to return when the request is successful.
§fn try_from_http_request<B, S>(
request: Request<B>,
path_args: &[S],
) -> Result<Request, FromHttpRequestError>
fn try_from_http_request<B, S>( request: Request<B>, path_args: &[S], ) -> Result<Request, FromHttpRequestError>
Tries to turn the given
http::Request into this request type,
together with the corresponding path arguments. Read more§fn check_request_method(method: &Method) -> Result<(), FromHttpRequestError>
fn check_request_method(method: &Method) -> Result<(), FromHttpRequestError>
Check whether the given HTTP method from an incoming request is compatible with the expected
METHOD of this endpoint.§impl Metadata for Request
impl Metadata for Request
§const METHOD: Method = ::ruma_common::exports::http::Method::PUT
const METHOD: Method = ::ruma_common::exports::http::Method::PUT
The HTTP method used by this endpoint.
§const RATE_LIMITED: bool = true
const RATE_LIMITED: bool = true
Whether or not this endpoint is rate limited by the server.
§const PATH_BUILDER: VersionHistory
const PATH_BUILDER: VersionHistory
All info pertaining to an endpoint’s path.
§type Authentication = AccessToken
type Authentication = AccessToken
What authentication scheme the server uses for this endpoint.
§type PathBuilder = VersionHistory
type PathBuilder = VersionHistory
The type used to build an endpoint’s path.
§fn empty_request_body<B>() -> B
fn empty_request_body<B>() -> B
Returns an empty request body for this Matrix request. Read more
§fn make_endpoint_url(
path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>,
base_url: &str,
path_args: &[&dyn Display],
query_string: &str,
) -> Result<String, IntoHttpError>
fn make_endpoint_url( path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>, base_url: &str, path_args: &[&dyn Display], query_string: &str, ) -> Result<String, IntoHttpError>
Generate the endpoint URL for this endpoint.
§impl OutgoingRequest for Request
impl OutgoingRequest for Request
§type EndpointError = Error
type EndpointError = Error
A type capturing the expected error conditions the server can return.
§type IncomingResponse = Response
type IncomingResponse = Response
Response type returned when the request is successful.
§fn try_into_http_request<T>(
self,
base_url: &str,
authentication_input: <<Request as Metadata>::Authentication as AuthScheme>::Input<'_>,
path_builder_input: <<Request as Metadata>::PathBuilder as PathBuilder>::Input<'_>,
) -> Result<Request<T>, IntoHttpError>
fn try_into_http_request<T>( self, base_url: &str, authentication_input: <<Request as Metadata>::Authentication as AuthScheme>::Input<'_>, path_builder_input: <<Request as Metadata>::PathBuilder as PathBuilder>::Input<'_>, ) -> Result<Request<T>, IntoHttpError>
Tries to convert this request into an
http::Request. Read moreAuto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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,
§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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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>
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§impl<T> OutgoingRequestAppserviceExt for Twhere
T: OutgoingRequest,
<T as Metadata>::Authentication: for<'a> AuthScheme<Input<'a> = SendAccessToken<'a>>,
impl<T> OutgoingRequestAppserviceExt for Twhere
T: OutgoingRequest,
<T as Metadata>::Authentication: for<'a> AuthScheme<Input<'a> = SendAccessToken<'a>>,
§fn try_into_http_request_with_identity<T>(
self,
base_url: &str,
access_token: SendAccessToken<'_>,
identity: AppserviceUserIdentity<'_>,
path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>,
) -> Result<Request<T>, IntoHttpError>
fn try_into_http_request_with_identity<T>( self, base_url: &str, access_token: SendAccessToken<'_>, identity: AppserviceUserIdentity<'_>, path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>, ) -> Result<Request<T>, IntoHttpError>
Tries to convert this request into an
http::Request and adds the given
AppserviceUserIdentity to it, if the identity is not empty.