Skip to main content

Lpm

Struct Lpm 

pub struct Lpm {
    pub(crate) inner: Lpm,
}
Expand description

Connection to the LPM kernel module.

See the crate level documentation for more information.

Fields§

§inner: Lpm

Implementations§

§

impl Lpm

pub fn new(config: Config) -> Result<Self>

Loads the LPM kernel module with config and connects to it.

If the module is already loaded, it is unloaded first. Dropping the Lpm unloads the module.

§Errors

Returns an error if the pull selection can’t be set, the kernel module can’t be loaded or the netlink handshake fails. Returns io::ErrorKind::ResourceBusy if another process uses the module and io::ErrorKind::Unsupported on platforms other than Linux.

§Panics

Panics if it isn’t called within a Tokio runtime with the I/O driver enabled.

pub async fn next(&mut self) -> Result<Edge>

Waits for the next edge event on the input pin.

§Errors

Returns an error if receiving from the kernel module fails or the message is invalid.

Trait Implementations§

§

impl Debug for Lpm

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Lpm

§

impl !UnwindSafe for Lpm

§

impl Freeze for Lpm

§

impl Send for Lpm

§

impl Sync for Lpm

§

impl Unpin for Lpm

§

impl UnsafeUnpin for Lpm

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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, <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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more