Struct ev3dev_lang_rust::Driver[][src]

pub struct Driver { /* fields omitted */ }

Helper struct that manages attributes. It creates an Attribute instance if it does not exists or uses a cached one.

Implementations

impl Driver[src]

pub fn new(class_name: &str, name: &str) -> Driver[src]

Returns a new Driver. All attributes created by this driver will use the path /sys/class/{class_name}/{name}.

pub fn find_name_by_port_and_driver(
    class_name: &str,
    port: &dyn Port,
    driver_name: &str
) -> Ev3Result<String>
[src]

Returns the name of the device with the given class_name, driver_name and at the given port.

Returns Ev3Error::NotFound if no such device exists.

pub fn find_name_by_driver(
    class_name: &str,
    driver_name: &str
) -> Ev3Result<String>
[src]

Returns the name of the device with the given class_name.

Returns Ev3Error::NotFound if no such device exists. Returns Ev3Error::MultipleMatches if more then one matching device exists.

pub fn find_names_by_driver(
    class_name: &str,
    driver_name: &str
) -> Ev3Result<Vec<String>>
[src]

Returns the names of the devices with the given class_name.

pub fn get_attribute(&self, attribute_name: &str) -> Attribute[src]

Return the Attribute wrapper for the given attribute_name. Creates a new one if it does not exist.

Trait Implementations

impl Clone for Driver[src]

impl Debug for Driver[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.