Skip to main content

DialectConnection

Struct DialectConnection 

Source
pub struct DialectConnection<D> { /* private fields */ }
Available on crate feature std only.
Expand description

A concrete blocking connection using a dialect.

Trait Implementations§

Source§

impl<D> MavConnection<<D as Dialect>::Message> for DialectConnection<D>
where D: Dialect + Send + Sync,

Source§

fn recv(&self) -> Result<(MavHeader, <D as Dialect>::Message), MessageReadError>

Receive a MAVLink message. Read more
Source§

fn recv_raw(&self) -> Result<MAVLinkMessageRaw, MessageReadError>

Receive a raw, unparsed MAVLink message. Read more
Source§

fn try_recv( &self, ) -> Result<(MavHeader, <D as Dialect>::Message), MessageReadError>

Try to receive a MAVLink message. Read more
Source§

fn send( &self, header: &MavHeader, data: &<D as Dialect>::Message, ) -> Result<usize, MessageWriteError>

Send a MAVLink message. Read more
Source§

fn send_raw(&self, data: &MAVLinkMessageRaw) -> Result<usize, MessageWriteError>

Send a raw, unparsed MAVLink message. Read more
Source§

fn set_protocol_version(&mut self, version: MavlinkVersion)

Sets the MAVLink version to use for receiving (when allow_recv_any_version() is false) and sending messages.
Source§

fn protocol_version(&self) -> MavlinkVersion

Gets the currently used MAVLink version
Source§

fn set_allow_recv_any_version(&mut self, allow: bool)

Set wether MAVLink messages of either version may be received. Read more
Source§

fn allow_recv_any_version(&self) -> bool

Wether messages of any MAVLink version may be received.
Source§

fn setup_signing(&mut self, signing_data: Option<SigningConfig>)

Available on crate feature mav2-message-signing only.
Setup secret key used for message signing, or disable message signing
Source§

fn send_frame(&self, frame: &MavFrame<M>) -> Result<usize, MessageWriteError>
where M: Message,

Write whole frame. Read more
Source§

fn recv_frame(&self) -> Result<MavFrame<M>, MessageReadError>
where M: Message,

Read whole frame. Read more
Source§

fn send_default(&self, data: &M) -> Result<usize, MessageWriteError>

Send a message with default header. Read more

Auto Trait Implementations§

§

impl<D> !Freeze for DialectConnection<D>

§

impl<D> RefUnwindSafe for DialectConnection<D>
where D: RefUnwindSafe,

§

impl<D> Send for DialectConnection<D>
where D: Send,

§

impl<D> Sync for DialectConnection<D>
where D: Sync,

§

impl<D> Unpin for DialectConnection<D>
where D: Unpin,

§

impl<D> UnsafeUnpin for DialectConnection<D>
where D: UnsafeUnpin,

§

impl<D> UnwindSafe for DialectConnection<D>
where D: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.