pub struct Sender<W: Write, V: MaybeVersioned> { /* private fields */ }
Expand description
Sends MAVLink frames.
Sends MAVLink frames to an instance of Write
.
Implementations§
source§impl<W: Write> Sender<W, Versionless>
impl<W: Write> Sender<W, Versionless>
sourcepub fn new<V: MaybeVersioned>(writer: W) -> Sender<W, V>
pub fn new<V: MaybeVersioned>(writer: W) -> Sender<W, V>
Default constructor.
sourcepub fn versionless(writer: W) -> Self
pub fn versionless(writer: W) -> Self
Create a MAVLink version agnostic sender.
Creates a protocol-agnostic sender which can send both MAVLink 1
and MAVLink 2
frames.
If you want a sender that sends only frames restricted to a particular MAVLink protocol
version, use Sender::versioned
.
If you want to instantiate a generic sender, use Sender::new
.
sourcepub fn versioned<Version: Versioned>(
writer: W,
version: Version,
) -> Sender<W, Version>
pub fn versioned<Version: Versioned>( writer: W, version: Version, ) -> Sender<W, Version>
Create a receiver specific to a particular MAVLink protocol version.
Same as Sender::new::<V1>
/ Sender::new::<V2>
but with an explicit version
marker as parameter.
If you want to send both MAVLink 1
and MAVLink 2
frames, use Sender::versionless
.
source§impl<W: Write, V: MaybeVersioned> Sender<W, V>
impl<W: Write, V: MaybeVersioned> Sender<W, V>
sourcepub fn send(&mut self, frame: &Frame<V>) -> Result<usize>
pub fn send(&mut self, frame: &Frame<V>) -> Result<usize>
Sends MAVLink Frame
.
Blocks until all bytes written and returns the number of bytes sent.
Versioned
sender accepts only frames of a specific MAVLink protocol version.
Versionless
sender accepts both MAVLink 1
and MAVLink 2
frames as
Frame<Versionless>
.
Trait Implementations§
Auto Trait Implementations§
impl<W, V> Freeze for Sender<W, V>where
W: Freeze,
impl<W, V> RefUnwindSafe for Sender<W, V>where
W: RefUnwindSafe,
V: RefUnwindSafe,
impl<W, V> Send for Sender<W, V>where
W: Send,
impl<W, V> Sync for Sender<W, V>where
W: Sync,
impl<W, V> Unpin for Sender<W, V>
impl<W, V> UnwindSafe for Sender<W, V>where
W: UnwindSafe,
V: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)