Struct ev3dev_lang_rust::Driver [−][src]
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]
class_name: &str,
port: &dyn Port,
driver_name: &str
) -> Ev3Result<String>
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]
class_name: &str,
driver_name: &str
) -> Ev3Result<String>
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]
class_name: &str,
driver_name: &str
) -> Ev3Result<Vec<String>>
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
Auto Trait Implementations
impl !RefUnwindSafe for Driver
[src]
impl Send for Driver
[src]
impl !Sync for Driver
[src]
impl Unpin for Driver
[src]
impl UnwindSafe for Driver
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,