Struct gmt_dos_clients_transceiver::Transceiver
source · pub struct Transceiver<U: UniqueIdentifier, F = Unset, S = Off> {
pub rx: Option<Receiver<Data<U>>>,
/* private fields */
}
Expand description
Transmitter and receiver of gmt_dos-actors Data
Fields§
§rx: Option<Receiver<Data<U>>>
Implementations§
source§impl<U: UniqueIdentifier> Transceiver<U>
impl<U: UniqueIdentifier> Transceiver<U>
sourcepub fn receiver<S: Into<String>, C: Into<String>>(
server_address: S,
client_address: C
) -> Result<Transceiver<U, Receiver>>
pub fn receiver<S: Into<String>, C: Into<String>>( server_address: S, client_address: C ) -> Result<Transceiver<U, Receiver>>
Transceiver receiver functionality
A receiver is build from both the transmitter and the receiver internet socket addresses
§Examples
let tx_address = "127.0.0.1:5001";
let rx_address = "127.0.0.1:500";
let tx = Transceiver::<IO>::receiver(tx_address,rx_address).unwrap();
pub fn receiver_builder<S: Into<String>, C: Into<String>>( server_address: S, client_address: C ) -> ReceiverBuilder<U>
source§impl<U: UniqueIdentifier> Transceiver<U, Receiver>
impl<U: UniqueIdentifier> Transceiver<U, Receiver>
sourcepub fn spawn<V: UniqueIdentifier, A: Into<String>>(
&self,
server_address: A
) -> Result<Transceiver<V, Receiver>>
pub fn spawn<V: UniqueIdentifier, A: Into<String>>( &self, server_address: A ) -> Result<Transceiver<V, Receiver>>
Spawn a new Transceiver receiver
clone the receiver endpoint that will
server_address
to connect to
source§impl<U: UniqueIdentifier + 'static> Transceiver<U, Receiver>
impl<U: UniqueIdentifier + 'static> Transceiver<U, Receiver>
source§impl<U: UniqueIdentifier> Transceiver<U>
impl<U: UniqueIdentifier> Transceiver<U>
sourcepub fn transmitter<S: Into<String>>(
address: S
) -> Result<Transceiver<U, Transmitter>>
pub fn transmitter<S: Into<String>>( address: S ) -> Result<Transceiver<U, Transmitter>>
Transceiver transmitter functionality
A transmitter is build from its internet socket address
§Examples
let address = "127.0.0.1:5001";
let tx = Transceiver::<IO>::transmitter(address).unwrap();
pub fn transmitter_builder<S: Into<String>>(address: S) -> TransmitterBuilder<U>
source§impl<U: UniqueIdentifier + 'static> Transceiver<U, Transmitter>
impl<U: UniqueIdentifier + 'static> Transceiver<U, Transmitter>
sourcepub fn run(self, monitor: &mut Monitor) -> Transceiver<U, Transmitter, On>
pub fn run(self, monitor: &mut Monitor) -> Transceiver<U, Transmitter, On>
Send data to the receiver
Communication with the receiver happens in a separate thread. The transmitter will hold until the receiver calls in.
source§impl<U: UniqueIdentifier, F> Transceiver<U, F>
impl<U: UniqueIdentifier, F> Transceiver<U, F>
source§impl<U: UniqueIdentifier, F, S> Transceiver<U, F, S>
impl<U: UniqueIdentifier, F, S> Transceiver<U, F, S>
pub fn take_channel_receiver(&mut self) -> Option<Receiver<Data<U>>>
Trait Implementations§
source§impl<U: UniqueIdentifier, F, S> Debug for Transceiver<U, F, S>
impl<U: UniqueIdentifier, F, S> Debug for Transceiver<U, F, S>
source§impl<U: UniqueIdentifier> From<&Transceiver<U, Receiver>> for CompactRecvr
impl<U: UniqueIdentifier> From<&Transceiver<U, Receiver>> for CompactRecvr
source§fn from(value: &Transceiver<U, Receiver>) -> Self
fn from(value: &Transceiver<U, Receiver>) -> Self
Converts to this type from the input type.
source§impl<U: UniqueIdentifier> Read<U> for Transceiver<U, Transmitter, On>
impl<U: UniqueIdentifier> Read<U> for Transceiver<U, Transmitter, On>
source§impl<U: UniqueIdentifier, F: RxOrTx + Send + Sync> Update for Transceiver<U, F, On>
impl<U: UniqueIdentifier, F: RxOrTx + Send + Sync> Update for Transceiver<U, F, On>
Auto Trait Implementations§
impl<U, F, S> Freeze for Transceiver<U, F, S>
impl<U, F = Unset, S = Off> !RefUnwindSafe for Transceiver<U, F, S>
impl<U, F, S> Send for Transceiver<U, F, S>
impl<U, F, S> Sync for Transceiver<U, F, S>
impl<U, F, S> Unpin for Transceiver<U, F, S>
impl<U, F = Unset, S = Off> !UnwindSafe for Transceiver<U, F, S>
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