pub struct Ep { /* private fields */ }Expand description
A tx5 endpoint representing an instance that can send and receive.
Implementations§
source§impl Ep
impl Ep
sourcepub async fn with_config<I: IntoConfig>(
into_config: I
) -> Result<(Self, ManyRcv<EpEvt>)>
pub async fn with_config<I: IntoConfig>( into_config: I ) -> Result<(Self, ManyRcv<EpEvt>)>
Construct a new tx5 endpoint with configuration.
sourcepub fn listen(
&self,
sig_url: Tx5Url
) -> impl Future<Output = Result<Tx5Url>> + 'static + Send
pub fn listen( &self, sig_url: Tx5Url ) -> impl Future<Output = Result<Tx5Url>> + 'static + Send
Establish a listening connection to a signal server, from which we can accept incoming remote connections. Returns the client url at which this endpoint may now be addressed.
sourcepub fn ban(&self, rem_id: Id, span: Duration)
pub fn ban(&self, rem_id: Id, span: Duration)
Close down all connections to, fail all outgoing messages to, and drop all incoming messages from, the given remote id, for the specified ban time period.
sourcepub fn send<B: Buf>(
&self,
rem_cli_url: Tx5Url,
data: B
) -> impl Future<Output = Result<()>> + 'static + Send
pub fn send<B: Buf>( &self, rem_cli_url: Tx5Url, data: B ) -> impl Future<Output = Result<()>> + 'static + Send
Send data to a remote on this tx5 endpoint. The future returned from this method will resolve when the data is handed off to our networking backend.
sourcepub fn broadcast<B: Buf>(
&self,
data: B
) -> impl Future<Output = Result<Vec<Result<()>>>> + 'static + Send
pub fn broadcast<B: Buf>( &self, data: B ) -> impl Future<Output = Result<Vec<Result<()>>>> + 'static + Send
Broadcast data to all connections that happen to be open. If no connections are open, no data will be broadcast. The future returned from this method will resolve when all broadcast messages have been handed off to our networking backend.
This method is currently not ideal. It naively gets a list of open connection urls and adds the broadcast to all of their queues. This could result in a connection being re-established just for the broadcast to occur.
Trait Implementations§
impl Eq for Ep
impl StructuralEq for Ep
impl StructuralPartialEq for Ep
Auto Trait Implementations§
impl !RefUnwindSafe for Ep
impl Send for Ep
impl Sync for Ep
impl Unpin for Ep
impl !UnwindSafe for Ep
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.