rust_p2p_core::pipe

Struct PipeWriter

source
pub struct PipeWriter<PeerID> { /* private fields */ }

Implementations§

source§

impl<PeerID> PipeWriter<PeerID>

source

pub fn udp_pipe_writer(&self) -> Option<&UdpPipeWriter>

Acquire a owned writer for writing to the pipe established by TCP

source

pub fn tcp_pipe_writer(&self) -> Option<&TcpPipeWriter>

Acquire a owned writer for writing to the pipe established by UDP

source

pub fn extensible_pipe_writer(&self) -> Option<&ExtensiblePipeWriter>

Acquire a owned writer for writing to the pipe established by other extended protocols

source

pub fn route_table(&self) -> &RouteTable<PeerID>

source§

impl<PeerID> PipeWriter<PeerID>

source

pub async fn send_to(&self, buf: BytesMut, route_key: &RouteKey) -> Result<()>

Writing buf to the target denoted by route_key

source

pub async fn send_to_addr<A: Into<SocketAddr>>( &self, connect_protocol: ConnectProtocol, buf: BytesMut, addr: A, ) -> Result<()>

Writing buf to the target denoted by SocketAddr with the specified protocol

source§

impl<PeerID: Hash + Eq> PipeWriter<PeerID>

source

pub async fn send_to_id(&self, buf: BytesMut, peer_id: &PeerID) -> Result<()>

Writing buf to the target named by peer_id

Trait Implementations§

source§

impl<PeerID: Clone> Clone for PipeWriter<PeerID>

source§

fn clone(&self) -> PipeWriter<PeerID>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<PeerID> Freeze for PipeWriter<PeerID>

§

impl<PeerID> !RefUnwindSafe for PipeWriter<PeerID>

§

impl<PeerID> Send for PipeWriter<PeerID>
where PeerID: Send + Sync,

§

impl<PeerID> Sync for PipeWriter<PeerID>
where PeerID: Send + Sync,

§

impl<PeerID> Unpin for PipeWriter<PeerID>

§

impl<PeerID> !UnwindSafe for PipeWriter<PeerID>

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, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> FromRef<T> for U
where T: Clone, U: From<T>,

source§

fn from_ref(val_ref: &T) -> U

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, U> RefInto<T> for U
where U: Into<T> + Clone,

source§

fn ref_into(&self) -> T

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.
source§

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

source§

fn vzip(self) -> V