pub struct Connected<C> {
client: C,
connection: JoinHandle<Result<(), Disconnect>>,
}Expand description
A client whose connection runs in a task.
Fields§
§client: C§connection: JoinHandle<Result<(), Disconnect>>Implementations§
Source§impl<C> Connected<C>
impl<C> Connected<C>
Sourcepub fn connect<S>(builder: ClientBuilder<S, C>) -> Result<Self, Error>
pub fn connect<S>(builder: ClientBuilder<S, C>) -> Result<Self, Error>
Connects a client with REQUEST_TIMEOUT and spawns the connection.
§Errors
Returns an error if the client can’t connect.
Sourcepub fn spawn((client, connection): (C, Connection)) -> Self
pub fn spawn((client, connection): (C, Connection)) -> Self
Spawns the connection.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Connected<C>where
C: Freeze,
impl<C> RefUnwindSafe for Connected<C>where
C: RefUnwindSafe,
impl<C> Send for Connected<C>where
C: Send,
impl<C> Sync for Connected<C>where
C: Sync,
impl<C> Unpin for Connected<C>where
C: Unpin,
impl<C> UnsafeUnpin for Connected<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Connected<C>where
C: UnwindSafe,
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