Struct ruma::server_util::authorization::XMatrix
source · #[non_exhaustive]pub struct XMatrix {
pub origin: OwnedServerName,
pub destination: Option<OwnedServerName>,
pub key: OwnedKeyId<SigningKeyAlgorithm, KeyName>,
pub sig: Base64,
}
Available on crate feature
server-util
only.Expand description
Typed representation of an Authorization
header of scheme X-Matrix
, as defined in the
Matrix Server-Server API.
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.origin: OwnedServerName
The server name of the sending server.
destination: Option<OwnedServerName>
The server name of the receiving sender.
For compatibility with older servers, recipients should accept requests without this parameter, but MUST always send it. If this property is included, but the value does not match the receiving server’s name, the receiving server must deny the request with an HTTP status code 401 Unauthorized.
key: OwnedKeyId<SigningKeyAlgorithm, KeyName>
The ID - including the algorithm name - of the sending server’s key that was used to sign the request.
sig: Base64
The signature of the JSON.
Implementations§
source§impl XMatrix
impl XMatrix
sourcepub fn new(
origin: OwnedServerName,
destination: OwnedServerName,
key: OwnedKeyId<SigningKeyAlgorithm, KeyName>,
sig: Base64,
) -> XMatrix
pub fn new( origin: OwnedServerName, destination: OwnedServerName, key: OwnedKeyId<SigningKeyAlgorithm, KeyName>, sig: Base64, ) -> XMatrix
Construct a new X-Matrix Authorization header.
Trait Implementations§
source§impl Credentials for XMatrix
impl Credentials for XMatrix
source§const SCHEME: &'static str = "X-Matrix"
const SCHEME: &'static str = "X-Matrix"
The scheme identify the format of these credentials. Read more
source§fn decode(value: &HeaderValue) -> Option<XMatrix>
fn decode(value: &HeaderValue) -> Option<XMatrix>
Try to decode the credentials from the
HeaderValue
. Read moresource§fn encode(&self) -> HeaderValue
fn encode(&self) -> HeaderValue
Encode the credentials to a
HeaderValue
. Read moresource§impl From<&XMatrix> for HeaderValue
impl From<&XMatrix> for HeaderValue
source§fn from(value: &XMatrix) -> HeaderValue
fn from(value: &XMatrix) -> HeaderValue
Converts to this type from the input type.
source§impl TryFrom<&HeaderValue> for XMatrix
impl TryFrom<&HeaderValue> for XMatrix
source§type Error = XMatrixParseError
type Error = XMatrixParseError
The type returned in the event of a conversion error.
source§fn try_from(
value: &HeaderValue,
) -> Result<XMatrix, <XMatrix as TryFrom<&HeaderValue>>::Error>
fn try_from( value: &HeaderValue, ) -> Result<XMatrix, <XMatrix as TryFrom<&HeaderValue>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for XMatrix
impl RefUnwindSafe for XMatrix
impl Send for XMatrix
impl Sync for XMatrix
impl Unpin for XMatrix
impl UnwindSafe for XMatrix
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, 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,
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