Skip to main content

ArcedConnector

Struct ArcedConnector 

Source
pub struct ArcedConnector(/* private fields */);
Expand description

An Arced and type-erased Connector

Implementations§

Source§

impl ArcedConnector

Source

pub fn new(connector: impl Connector) -> Self

Constructs a new ArcedConnector

Source

pub fn is<T: Any + 'static>(&self) -> bool

Determine if this ArcedConnector is the specified type

Source

pub fn downcast_ref<T: Any + 'static>(&self) -> Option<&T>

Attempt to borrow this ArcedConnector as the provided type, returning None if it does not contain the type

Source

pub fn downcast_mut<T: Any + 'static>(&mut self) -> Option<&mut T>

Attempt to mutably borrow this ArcedConnector as the provided type, returning None if it does not contain the type or if there are multiple outstanding clones of this arc

Source

pub fn runtime(&self) -> Runtime

Returns an object-safe Runtime

Trait Implementations§

Source§

impl Clone for ArcedConnector

Source§

fn clone(&self) -> ArcedConnector

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Connector for ArcedConnector

Source§

type Runtime = Runtime

The RuntimeTrait for this Connector
Source§

type Transport = Box<dyn Transport>

the Transport that connect returns
Source§

type Udp = ()

The async UDP socket type for this connector. Used by QUIC adapters for HTTP/3 support. Connectors that do not support UDP should set this to ().
Source§

async fn connect(&self, url: &Url) -> Result<Box<dyn Transport>>

Initiate a connection to the provided url
Source§

fn arced(self) -> ArcedConnector

Returns an object-safe ArcedConnector. Do not implement this.
Source§

fn runtime(&self) -> Self::Runtime

Returns the runtime
Source§

async fn resolve(&self, host: &str, port: u16) -> Result<Vec<SocketAddr>>

Perform a DNS lookup for a given host-and-port
Source§

impl Debug for ArcedConnector

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.