[−][src]Struct splinter::mesh::Mesh
A Connection reactor
Methods
impl Mesh
[src]
pub fn new(incoming_capacity: usize, outgoing_capacity: usize) -> Self
[src]
Create a new mesh, spawning a background thread for sending and receiving, and setting up channels to communicate with it.
pub fn add(&self, connection: Box<dyn Connection>) -> Result<usize, AddError>
[src]
Add a new connection to the mesh, moving it to the background thread, and return its id.
pub fn remove(&self, id: usize) -> Result<Box<dyn Connection>, RemoveError>
[src]
Remove an existing connection from the mesh and return it.
pub fn send(&self, envelope: Envelope) -> Result<(), SendError>
[src]
Send the envelope on the mesh.
This is a convenience function and is equivalent to
mesh.outgoing(envelope.id()).send(envelope.take_payload())
.
pub fn recv(&self) -> Result<Envelope, RecvError>
[src]
Receive a new envelope from the mesh.
pub fn recv_timeout(
&self,
timeout: Duration
) -> Result<Envelope, RecvTimeoutError>
[src]
&self,
timeout: Duration
) -> Result<Envelope, RecvTimeoutError>
Receive a new envelope from the mesh.
pub fn outgoing(&self, id: usize) -> Option<Outgoing>
[src]
Create a new handle for sending to the existing connection with the given id.
This may be faster if many sends on the same Connection are going to be performed because the internal lock around the pool of senders does not need to be reacquired.
pub fn incoming(&self) -> Incoming
[src]
Create a new handle for receiving envelopes from the mesh.
This is useful if an object only needs to receive and doesn't need to send.
pub fn get_life_cycle(&self) -> MeshLifeCycle
[src]
pub fn get_sender(&self) -> MeshMatrixSender
[src]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Mesh
impl Send for Mesh
impl !Sync for Mesh
impl Unpin for Mesh
impl !UnwindSafe for Mesh
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Clone + Send + Sync,
T: 'a + Clone + Send + Sync,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoSql for T
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
&'a Self: AsExpression<T>,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
fn self_address_mut(&mut self) -> *mut ()
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,