Connection

Struct Connection 

Source
pub struct Connection<M: Message> { /* private fields */ }
Available on crate feature std only.
Expand description

Concrete MAVLink connection returned by connect.

Trait Implementations§

Source§

impl<M: Message> MavConnection<M> for Connection<M>

Source§

fn recv(&self) -> Result<(MavHeader, M), 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, M), MessageReadError>

Try to receive a MAVLink message. Read more
Source§

fn send(&self, header: &MavHeader, data: &M) -> Result<usize, MessageWriteError>

Send a 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 signing only.
Setup secret key used for message signing, or disable message signing
Source§

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

Write whole frame Read more
Source§

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

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<M> !Freeze for Connection<M>

§

impl<M> RefUnwindSafe for Connection<M>
where M: RefUnwindSafe,

§

impl<M> Send for Connection<M>
where M: Send,

§

impl<M> Sync for Connection<M>
where M: Sync,

§

impl<M> Unpin for Connection<M>
where M: Unpin,

§

impl<M> UnwindSafe for Connection<M>
where M: 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.