pub struct ConnectionRequest { /* private fields */ }
Expand description

Contains information about a remote peer that has requested a connection.

Connection requests and their authorization are scoped to a specific Ditto peer and connection type.

Information about a peer Ditto is currently trying to connect to. This struct is used by the Presence::set_connection_request_handler() callback to decide whether the Ditto client should connect to a given peer or not.

Implementations§

source§

impl ConnectionRequest

source

pub fn peer_metadata_json_str(&self) -> String

JSON-encoded metadata associated with the remote peer.

JSON string representing an empty dictionary if the remote peer has not set any metadata or when this request is for a WebSocket connection.

Set peer metadata for the local peer using Presence::set_peer_metadata() or Presence::set_peer_metadata_json_str().

source

pub fn peer_metadata_serde<T: DeserializeOwned>(&self) -> Result<T>

source

pub fn peer_metadata(&self) -> Arc<Map<String, Value>>

Metadata associated with the remote peer.

Empty dictionary if the remote peer has not set any metadata, or when this request is for a WebSocket connection (which does not currently support peer metadata).

Set peer metadata for the local peer using Presence::set_peer_metadata() or Presence::set_peer_metadata_json_str().

Convenience property that wraps Self::peer_metadata_json_str().

source

pub fn identity_service_metadata_json_str(&self) -> String

JSON-encoded metadata for the remote peer that is provided by the identity service.

Use an authentication webhook to set this value. See Ditto’s online documentation for more information on how to configure an authentication webhook.

source

pub fn identity_service_metadata_serde<T: DeserializeOwned>(&self) -> Result<T>

source

pub fn identity_service_metadata(&self) -> Arc<Map<String, Value>>

Metadata for the remote peer that is provided by the identity service.

Use an authentication webhook to set this value. See Ditto’s online documentation for more information on how to configure an authentication webhook.

Convenience property that wraps Self::identity_service_metadata_json_str().

source

pub fn peer_key_string(&self) -> Arc<str>

The unique peer key of the remote peer.

source

pub fn connection_type(&self) -> ConnectionType

The network transport of this connection request.

Expect to receive separate connection requests for each network transport that connects the local and remote peer.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
§

impl<T> FitForCBox for T

§

type CBoxWrapped = Box_<T>

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ManuallyDropMut for T

§

type Ret = ManuallyDrop<T>

§

fn manually_drop_mut<'__>(&'__ mut self) -> &'__ mut ManuallyDrop<T>

§

impl<T> To for Twhere T: ?Sized,

§

fn to<T>(self) -> Twhere Self: Into<T>,

Converts to T by calling Into<T>::into.
§

fn try_to<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V