UdevDevice

Struct UdevDevice 

Source
pub struct UdevDevice { /* private fields */ }
Expand description

Represents one kernel sys device.

Implementations§

Source§

impl UdevDevice

Source

pub fn new(udev: Arc<Udev>) -> Self

Creates a new UdevDevice.

Source

pub fn udev(&self) -> &Udev

Gets a reference to the Udev context.

Source

pub fn udev_cloned(&self) -> Arc<Udev>

Gets a cloned reference to the Udev context.

Source

pub fn new_from_nulstr(udev: Arc<Udev>, buf: &[u8]) -> Result<Self>

Creates a new UdevDevice.

Source

pub fn new_from_syspath(udev: Arc<Udev>, syspath: &str) -> Result<Self>

Creates new UdevDevice, and fills in information from the sys device and the udev database entry.

The syspath is the absolute path to the device, including the sys mount point.

The initial refcount is 1, and needs to be decremented to release the resources of the udev device.

Returns: a new UdevDevice, or Error, if it does not exist

Source

pub fn new_from_devnum( udev: Arc<Udev>, devtype: &str, devnum: dev_t, ) -> Result<Self>

Creates new UdevDevice.

From the libudev documentation:

Fills in information from the `sys` device and the udev database entry.

The device is looked-up by its major/minor number and type. Character and block device
numbers are not unique across the two types.

Parameters:

  • udev: Udev library context
  • type: char or block device
  • devnum: device major/minor number

Returns: a new UdevDevice, or Err, if it does not exist

Source

pub fn new_from_subsystem_sysname( udev: Arc<Udev>, subsystem: &str, sysname: &str, ) -> Result<Self>

Creates a new UdevDevice from the subsystem and sysname.

From the libudev documentation:

Fills in information from the sys device and the udev database entry.

The device is looked up by the subsystem and name string of the device, like "mem" / "zero", or "block" / "sda".

Parameters:

  • udev: Udev library context
  • subsystem: the subsystem of the device
  • sysname: the name of the device

Returns: a new UdevDevice, or Err, if it does not exist

Source

pub fn new_from_device_id(udev: Arc<Udev>, id: &str) -> Result<Self>

Create new UdevDevice from an ID string.

From the libudev documentation:


Fill in information from the sys device and the udev database entry.

The device is looked-up by a special string:

  b8:2          - block device major:minor
  c128:1        - char device major:minor
  n3            - network device ifindex
  +sound:card29 - kernel driver core subsystem:device name

Parameters:

  • udev: udev library context
  • id: text string identifying a kernel device

Returns: a new UdevDevice, or Err, if it does not exist

Source

pub fn new_from_environment(udev: Arc<Udev>) -> Result<Self>

Create new udev device from the environment information.

From the original libudev documnentation:

Fills in information from the current process environment.
This only works reliable if the process is called from a udev rule.
It is usually used for tools executed from IMPORT= rules.

Parameters:

  • udev: Udev library context

Returns: a new UdevDevice, or Err, if it does not exist

Source

pub fn new_from_parent(&self) -> Result<Self>

Creates a new UdevDevice from the next parent directory in the syspath.

Returns an Err if no parent is found.

Source

pub fn get_parent(&mut self) -> Result<Arc<Self>>

Gets the next parent UdevDevice.

From the libudev documentation:

Find the next parent device, and fill in information from the sys
device and the udev database entry.

@udev_device: the device to start searching from

Returned device is not referenced. It is attached to the child
device, and will be cleaned up when the child device is cleaned up.

It is not necessarily just the upper level directory, empty or not
recognized sys directories are ignored.

It can be called as many times as needed, without caring about
references.

Returns: a new UdevDevice, or Err, if it no parent exists.

Source

pub fn get_parent_with_subsystem_devtype( &mut self, subsystem: &str, devtype: &str, ) -> Result<Arc<Self>>

Gets the next parent UdevDevice based on subsystem and devtype.

From the libudev documentation:

Find the next parent device, with a matching subsystem and devtype
value, and fill in information from the sys device and the udev
database entry.

If devtype is #NULL, only subsystem is checked, and any devtype will
match.

Returned device is not referenced. It is attached to the child
device, and will be cleaned up when the child device is cleaned up.

It can be called as many times as needed, without caring about
references.

Parameters:

  • udev_device: udev device to start searching from
  • subsystem: the subsystem of the device
  • devtype: the type (DEVTYPE) of the device

Returns: a new UdevDevice, or Err if no matching parent exists.

Source

pub const fn parent_set(&self) -> bool

Gets whether a parent UdevDevice is set.

Source

pub fn syspath(&self) -> &str

Gets the UdevDevice syspath.

Source

pub fn set_syspath<P: Into<String>>(&mut self, syspath: P)

Sets the UdevDevice syspath.

Source

pub fn with_syspath<P: Into<String>>(self, syspath: P) -> Self

Builder function that sets the UdevDevice syspath.

Source

pub fn devpath(&self) -> &str

Gets the UdevDevice devpath.

Source

pub fn set_devpath<P: Into<String>>(&mut self, devpath: P)

Sets the UdevDevice devpath.

Source

pub fn with_devpath<P: Into<String>>(self, devpath: P) -> Self

Builder function that sets the UdevDevice devpath.

Source

pub fn sysname(&self) -> &str

Gets the UdevDevice sysname.

Source

pub fn set_sysname<P: Into<String>>(&mut self, sysname: P)

Sets the UdevDevice sysname.

Source

pub fn with_sysname<P: Into<String>>(self, sysname: P) -> Self

Builder function that sets the UdevDevice sysname.

Source

pub fn sysnum(&self) -> &str

Gets the UdevDevice sysnum.

Source

pub fn set_sysnum<P: Into<String>>(&mut self, sysnum: P)

Sets the UdevDevice sysnum.

Source

pub fn with_sysnum<P: Into<String>>(self, sysnum: P) -> Self

Builder function that sets the UdevDevice sysnum.

Source

pub fn devnode(&self) -> &str

Gets the UdevDevice devnode.

Source

pub fn set_devnode<P: Into<String>>(&mut self, devnode: P)

Sets the UdevDevice devnode.

Source

pub fn with_devnode<P: Into<String>>(self, devnode: P) -> Self

Builder function that sets the UdevDevice devnode.

Source

pub fn get_devnode(&mut self) -> &str

Gets the UdevDevice devnode.

From the libudev documentation:

Retrieve the device node file name belonging to the udev device.
The path is an absolute path, and starts with the device directory.

Returns: the device node file name of the UdevDevice, or an empty string if none exists.

Source

pub const fn devnode_mode(&self) -> Mode

Gets the UdevDevice devnode Mode.

Source

pub fn set_devnode_mode(&mut self, devnode_mode: Mode)

Sets the UdevDevice devnode Mode.

Source

pub fn with_devnode_mode(self, devnode_mode: Mode) -> Self

Builder function sets the UdevDevice devnode Mode.

Source

pub const fn devnode_gid(&self) -> u32

Gets the UdevDevice devnode GID.

Source

pub fn set_devnode_gid(&mut self, gid: u32)

Sets the UdevDevice devnode GID.

Source

pub fn with_devnode_gid(self, gid: u32) -> Self

Builder function that sets the UdevDevice devnode GID.

Source

pub const fn devnode_uid(&self) -> u32

Gets the UdevDevice devnode UID.

Source

pub fn set_devnode_uid(&mut self, uid: u32)

Sets the UdevDevice devnode UID.

Source

pub fn with_devnode_uid(self, uid: u32) -> Self

Builder function that sets the UdevDevice devnode UID.

Source

pub fn subsystem(&self) -> &str

Gets the UdevDevice subsystem.

Source

pub fn set_subsystem<P: Into<String>>(&mut self, subsystem: P)

Sets the UdevDevice subsystem.

Source

pub fn with_subsystem<P: Into<String>>(self, subsystem: P) -> Self

Builder function that sets the UdevDevice subsystem.

Source

pub fn get_subsystem(&mut self) -> &str

Retrieves the subsystem string of the udev device.

The string does not contain any “/”.

Returns:

  • name of the subsystem of the udev device.
  • empty string if the subsystem can not be determined.
Source

pub fn devtype(&self) -> &str

Gets the UdevDevice devtype.

Source

pub fn set_devtype<P: Into<String>>(&mut self, devtype: P)

Sets the UdevDevice devtype.

Source

pub fn with_devtype<P: Into<String>>(self, devtype: P) -> Self

Builder function that sets the UdevDevice devtype.

Source

pub fn get_devtype(&mut self) -> &str

Gets the devtypes string of the UdevDevice.

If the devtype is unset, attempts to read properties from the syspath file.

Source

pub fn driver(&self) -> &str

Gets the UdevDevice driver.

Source

pub fn set_driver<P: Into<String>>(&mut self, driver: P)

Sets the UdevDevice driver.

Source

pub fn with_driver<P: Into<String>>(self, driver: P) -> Self

Builder function that sets the UdevDevice driver.

Source

pub fn get_driver(&mut self) -> Option<&str>

Gets the kernel driver name.

Returns: the kernel driver name, or None if none is attached.

Source

pub fn action(&self) -> &str

Gets the UdevDevice action.

Source

pub fn set_action<P: Into<String>>(&mut self, action: P)

Sets the UdevDevice action.

Source

pub fn with_action<P: Into<String>>(self, action: P) -> Self

Builder function that sets the UdevDevice action.

Source

pub fn devpath_old(&self) -> &str

Gets the UdevDevice devpath_old.

Source

pub fn set_devpath_old<P: Into<String>>(&mut self, devpath_old: P)

Sets the UdevDevice devpath_old.

Source

pub fn with_devpath_old<P: Into<String>>(self, devpath_old: P) -> Self

Builder function that sets the UdevDevice devpath_old.

Source

pub fn id_filename(&self) -> &str

Gets the UdevDevice id_filename.

Source

pub fn set_id_filename<P: Into<String>>(&mut self, id_filename: P)

Sets the UdevDevice id_filename.

Source

pub fn with_id_filename<P: Into<String>>(self, id_filename: P) -> Self

Builder function that sets the UdevDevice id_filename.

Source

pub fn get_id_filename(&mut self) -> &str

Gets the ID filename.

If the filename is empty, attempts to set it based on subsystem information.

Returns: the ID filename, or an empty string if none can be constructed.

Source

pub fn envp(&self) -> &[String]

Gets a reference to the list of envp arguments.

Source

pub fn envp_len(&self) -> usize

Gets the length of non-empty envp arguments.

Source

pub fn set_envp<P: Into<String> + Clone>(&mut self, envp: &[P])

Sets the list of envp arguments.

Source

pub fn with_envp<P: Into<String> + Clone>(self, envp: &[P]) -> Self

Builder function that sets the list of envp arguments.

Source

pub fn envp_is_empty(&self) -> bool

Gets whether the envp list is empty.

Source

pub fn clear_envp(&mut self)

Clears the envp arguments.

Source

pub fn monitor_buf(&self) -> &str

Gets the UdevDevice monitor_buf.

Source

pub fn set_monitor_buf<P: Into<String>>(&mut self, monitor_buf: P)

Sets the UdevDevice monitor_buf.

Source

pub fn with_monitor_buf<P: Into<String>>(self, monitor_buf: P) -> Self

Builder function that sets the UdevDevice monitor_buf.

Source

pub fn get_properties_monitor_buf(&mut self) -> &str

Gets the environment properties monitor buffer.

If the environment is not up to date, updates the monitor buffer.

Source

pub fn update_envp_monitor_buf(&mut self)

Updates the envp and monitor buffer from the properties list.

Gets a reference to the UdevDevice devlinks_list UdevList.

Gets a mutable reference to the UdevDevice devlinks_list UdevList.

Source

pub fn devlinks_list_entry(&self) -> Option<&UdevEntry>

Gets the next entry in the devlinks list.

Source

pub fn get_devlinks_list_entry(&mut self) -> Option<&UdevEntry>

Gets the list of device links for the UdevDevice.

From the libudev documentation:

Retrieve the list of device links pointing to the device file of
the udev device. The next list entry can be retrieved with
udev_list_entry_get_next(), which returns #NULL if no more entries exist.

The devlink path can be retrieved from the list entry by
udev_list_entry_get_name(). The path is an absolute path, and starts with
the device directory.

Returns: the first entry of the device node link list

Sets the UdevDevice devlinks_list UdevList.

Builder function sets the UdevDevice UdevList.

Adds an UdevEntry to the devlinks list.

Source

pub const fn properties_list(&self) -> &UdevList

Gets a reference to the UdevDevice properties_list UdevList.

Source

pub fn properties_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the UdevDevice properties_list UdevList.

Source

pub fn set_properties_list<U: Into<UdevEntryList>>( &mut self, properties_list: U, )

Sets the UdevDevice properties_list UdevList.

Source

pub fn with_properties_list<U: Into<UdevEntryList>>( self, properties_list: U, ) -> Self

Builder function sets the UdevDevice UdevList.

Source

pub fn get_property_value(&self, key: &str) -> Option<&str>

Gets the value of a given property.

Source

pub const fn sysattr_value_list(&self) -> &UdevList

Gets a reference to the UdevDevice sysattr_value_list UdevList.

Source

pub fn sysattr_value_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the UdevDevice sysattr_value_list UdevList.

Source

pub fn set_sysattr_value_list<U: Into<UdevEntryList>>( &mut self, sysattr_value_list: U, )

Sets the UdevDevice sysattr_value_list UdevList.

Source

pub fn with_sysattr_value_list<U: Into<UdevEntryList>>( self, sysattr_value_list: U, ) -> Self

Builder function sets the UdevDevice UdevList.

Source

pub const fn sysattr_list(&self) -> &UdevList

Gets a reference to the UdevDevice sysattr_list UdevList.

Source

pub fn sysattr_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the UdevDevice sysattr_list UdevList.

Source

pub fn set_sysattr_list<U: Into<UdevEntryList>>(&mut self, sysattr_list: U)

Sets the UdevDevice sysattr_list UdevList.

Source

pub fn with_sysattr_list<U: Into<UdevEntryList>>(self, sysattr_list: U) -> Self

Builder function sets the UdevDevice UdevList.

Source

pub fn get_sysattr_list_entry(&mut self) -> Option<&UdevEntry>

Gets the first entry in the sysattr properties list.

From the libudev documentation:

Retrieve the list of available sysattrs, with value being empty;
This just return all available sysfs attributes for a particular
device without reading their values.

Returns: the first entry of the property list

Source

pub fn get_sysattr_value(&mut self, sysattr: &str) -> Option<String>

Gets the sys attribute file value.

From the libudev documentation:

The retrieved value is cached in the device. Repeated calls will return the same
value and not open the attribute again.

Returns: the content of a sys attribute file, or None if there is no sys attribute value.

Source

pub const fn tags_list(&self) -> &UdevList

Gets a reference to the UdevDevice tags_list UdevList.

Source

pub fn tags_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the UdevDevice tags_list UdevList.

Source

pub fn set_tags_list<U: Into<UdevEntryList>>(&mut self, tags_list: U)

Sets the UdevDevice tags_list UdevList.

Source

pub fn with_tags_list<U: Into<UdevEntryList>>(self, tags_list: U) -> Self

Builder function sets the UdevDevice UdevList.

Source

pub fn tags_list_entry(&self) -> Option<&UdevEntry>

Gets the first tags list entry in the UdevDevice.

Source

pub fn get_tags_list_entry(&mut self) -> Option<&UdevEntry>

Gets the first tags list entry in the UdevDevice.

From the libudev documentation:

Retrieve the list of tags attached to the udev device. The next
list entry can be retrieved with udev_list_entry_get_next(),
which returns `None` if no more entries exist. The tag string
can be retrieved from the list entry by udev_list_entry_get_name().

Returns: the first entry of the tag list

Source

pub fn get_current_tags_list_entry(&mut self) -> Option<&UdevEntry>

Gets the current tags list entry in the UdevDevice.

From the libudev documentation:

Retrieve the list of tags attached to the udev device. The next
list entry can be retrieved with udev_list_entry_get_next(),
which returns `None` if no more entries exist. The tag string
can be retrieved from the list entry by udev_list_entry_get_name().

Returns: the current entry of the tag list

Source

pub fn add_tag(&mut self, tag: &str) -> Result<()>

Adds an UdevEntry to the tags list.

Source

pub fn has_tag(&mut self, tag: &str) -> bool

Gets whether the UdevDevice has the provided tag associated.

From the libudev documentation:

Check if a given device has a certain tag associated.
Source

pub const fn seqnum(&self) -> u64

Gets the UdevDevice seqnum.

Source

pub fn set_seqnum(&mut self, seqnum: u64)

Sets the UdevDevice seqnum.

Source

pub fn with_seqnum(self, seqnum: u64) -> Self

Builder function sets the UdevDevice seqnum.

Source

pub const fn usec_initialized(&self) -> u64

Gets the UdevDevice usec_initialized.

Source

pub fn set_usec_initialized(&mut self, usec_initialized: u64)

Sets the UdevDevice usec_initialized.

Source

pub fn with_usec_initialized(self, usec_initialized: u64) -> Self

Builder function sets the UdevDevice usec_initialized.

Source

pub fn get_usec_since_initialized(&mut self) -> u64

Gets the number of microseconds since the UdevDevice was initialized.

From the libudev documentation:

Return the number of microseconds passed since udev set up the
device for the first time.

This is only implemented for devices with need to store properties
in the udev database. All other devices return 0 here.

Returns: the number of microseconds since the device was first seen.

Gets the UdevDevice devlink priority.

Sets the UdevDevice devlink priority.

Builder function sets the UdevDevice devlink priority.

Source

pub const fn devnum(&self) -> u64

Gets the UdevDevice devnum.

Source

pub fn set_devnum(&mut self, devnum: u64)

Sets the UdevDevice devnum.

Source

pub fn with_devnum(self, devnum: u64) -> Self

Builder function sets the UdevDevice devnum.

Source

pub fn get_devnum(&mut self) -> u64

Gets the device major/minor number.

Source

pub const fn ifindex(&self) -> i32

Gets the UdevDevice ifindex.

Source

pub fn set_ifindex(&mut self, ifindex: i32)

Sets the UdevDevice ifindex.

Source

pub fn with_ifindex(self, ifindex: i32) -> Self

Builder function sets the UdevDevice ifindex.

Source

pub fn get_ifindex(&mut self) -> i32

Gets the UdevDevice ifindex.

If the information file is not loaded, reads and parses the file from disk.

Source

pub const fn watch_handle(&self) -> i32

Gets the UdevDevice watch handle.

Source

pub fn set_watch_handle(&mut self, watch_handle: i32)

Sets the UdevDevice watch handle.

Source

pub fn with_watch_handle(self, watch_handle: i32) -> Self

Builder function sets the UdevDevice watch handle.

Source

pub const fn maj(&self) -> i32

Gets the UdevDevice major number.

Source

pub fn set_maj(&mut self, maj: i32)

Sets the UdevDevice major number.

Source

pub fn with_maj(self, maj: i32) -> Self

Builder function sets the UdevDevice major number.

Source

pub const fn min(&self) -> i32

Gets the UdevDevice minor number.

Source

pub fn set_min(&mut self, min: i32)

Sets the UdevDevice minor number.

Source

pub fn with_min(self, min: i32) -> Self

Builder function sets the UdevDevice minor number.

Gets the UdevDevice devlinks up-to-date.

Sets the UdevDevice devlinks up-to-date.

Builder function sets the UdevDevice devlinks up-to-date.

Source

pub const fn envp_uptodate(&self) -> bool

Gets the UdevDevice envp up-to-date.

Source

pub fn set_envp_uptodate(&mut self, envp_uptodate: bool)

Sets the UdevDevice envp up-to-date.

Source

pub fn with_envp_uptodate(self, envp_uptodate: bool) -> Self

Builder function sets the UdevDevice envp up-to-date.

Source

pub const fn tags_uptodate(&self) -> bool

Gets the UdevDevice tags up-to-date.

Source

pub fn set_tags_uptodate(&mut self, tags_uptodate: bool)

Sets the UdevDevice tags up-to-date.

Source

pub fn with_tags_uptodate(self, tags_uptodate: bool) -> Self

Builder function sets the UdevDevice tags up-to-date.

Source

pub const fn info_loaded(&self) -> bool

Gets the UdevDevice info loaded.

Source

pub fn set_info_loaded(&mut self, info_loaded: bool)

Sets the UdevDevice info loaded.

Source

pub fn with_info_loaded(self, info_loaded: bool) -> Self

Builder function sets the UdevDevice info loaded.

Source

pub const fn db_loaded(&self) -> bool

Gets the UdevDevice db loaded.

Source

pub fn set_db_loaded(&mut self, db_loaded: bool)

Sets the UdevDevice db loaded.

Source

pub fn with_db_loaded(self, db_loaded: bool) -> Self

Builder function sets the UdevDevice db loaded.

Source

pub const fn uevent_loaded(&self) -> bool

Gets the UdevDevice uevent loaded.

Source

pub fn set_uevent_loaded(&mut self, uevent_loaded: bool)

Sets the UdevDevice uevent loaded.

Source

pub fn with_uevent_loaded(self, uevent_loaded: bool) -> Self

Builder function sets the UdevDevice uevent loaded.

Source

pub const fn is_initialized(&self) -> bool

Gets the UdevDevice is initialized.

Source

pub fn set_is_initialized(&mut self, is_initialized: bool)

Sets the UdevDevice is initialized.

Source

pub fn with_is_initialized(self, is_initialized: bool) -> Self

Builder function sets the UdevDevice is initialized.

Source

pub fn get_is_initialized(&mut self) -> bool

Gets whether the UdevDevice is initialized.

From the libudev documentation:

Check if udev has already handled the device and has set up
device node permissions and context, or has renamed a network
device.

This is only implemented for devices with a device node
or network interfaces. All other devices return 1 here.
Source

pub const fn sysattr_list_read(&self) -> bool

Gets the UdevDevice sysattr list read.

Source

pub fn set_sysattr_list_read(&mut self, sysattr_list_read: bool)

Sets the UdevDevice sysattr list read.

Source

pub fn with_sysattr_list_read(self, sysattr_list_read: bool) -> Self

Builder function sets the UdevDevice sysattr list read.

Source

pub fn get_sysattr_list_read(&mut self) -> Result<usize>

Source

pub const fn db_persist(&self) -> bool

Gets the UdevDevice database persist.

Source

pub fn set_db_persist(&mut self, db_persist: bool)

Sets the UdevDevice database persist.

Source

pub fn with_db_persist(self, db_persist: bool) -> Self

Builder function sets the UdevDevice database persist.

Source

pub fn read_db(&mut self) -> Result<()>

Reads UdevDevice information from the persistent database file.

Returns: Ok(()) on success, Err(Error) otherwise

Source

pub fn read_uevent_file(&mut self) -> Result<()>

Reads properties from the uevent file.

Source

pub fn add_property_from_string(&mut self, property: &str) -> Option<&UdevEntry>

Parses the property string, and adds an UdevEntry to the properties list.

Source

pub fn add_property_from_string_parse(&mut self, property: &str) -> Result<()>

Parses property string, and if needed, updates internal values accordingly.

From libudev documentation:

add_property_from_string_parse_finish() needs to be called after adding properties, and its return value checked.

set_info_loaded() needs to be set, to avoid trying to use a device without a DEVPATH set.

Source

pub fn add_property_from_string_parse_finish(&mut self) -> Result<()>

Finishes adding property information after parsing configuration string.

NOTE users should call this function after the final call to (add_property_from_string_parse)Self::add_property_from_string_parse.

Trait Implementations§

Source§

impl Clone for UdevDevice

Source§

fn clone(&self) -> UdevDevice

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UdevDevice

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for UdevDevice

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for UdevDevice

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for UdevDevice

Source§

fn eq(&self, other: &UdevDevice) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for UdevDevice

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.