pub struct FunctionDir { /* private fields */ }Expand description
USB gadget function directory container.
Stores the directory in configfs of a USB function and provides access methods.
Implementations§
Source§impl FunctionDir
impl FunctionDir
Sourcepub fn property_path(&self, name: impl AsRef<Path>) -> Result<PathBuf>
pub fn property_path(&self, name: impl AsRef<Path>) -> Result<PathBuf>
Path to the specified property.
Sourcepub fn create_dir_all(&self, name: impl AsRef<Path>) -> Result<()>
pub fn create_dir_all(&self, name: impl AsRef<Path>) -> Result<()>
Create a subdirectory and its parent directories.
Sourcepub fn read_string(&self, name: impl AsRef<Path>) -> Result<String>
pub fn read_string(&self, name: impl AsRef<Path>) -> Result<String>
Read and trim a string property.
Sourcepub fn read_os_string(&self, name: impl AsRef<Path>) -> Result<OsString>
pub fn read_os_string(&self, name: impl AsRef<Path>) -> Result<OsString>
Read an trim an OS string property.
Sourcepub fn write(
&self,
name: impl AsRef<Path>,
value: impl AsRef<[u8]>,
) -> Result<()>
pub fn write( &self, name: impl AsRef<Path>, value: impl AsRef<[u8]>, ) -> Result<()>
Write a property.
Sourcepub fn symlink(
&self,
target: impl AsRef<Path>,
link: impl AsRef<Path>,
) -> Result<()>
pub fn symlink( &self, target: impl AsRef<Path>, link: impl AsRef<Path>, ) -> Result<()>
Create a symbolic link.
Sourcepub fn dev_numbers(&self) -> Result<(u32, u32)>
pub fn dev_numbers(&self) -> Result<(u32, u32)>
Device major and minor numbers.
Reads the dev property from configfs, which contains the device
numbers in the major:minor format.
Not all function types expose a dev property.
Trait Implementations§
Source§impl Clone for FunctionDir
impl Clone for FunctionDir
Source§fn clone(&self) -> FunctionDir
fn clone(&self) -> FunctionDir
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FunctionDir
impl Debug for FunctionDir
Auto Trait Implementations§
impl Freeze for FunctionDir
impl RefUnwindSafe for FunctionDir
impl Send for FunctionDir
impl Sync for FunctionDir
impl Unpin for FunctionDir
impl UnsafeUnpin for FunctionDir
impl UnwindSafe for FunctionDir
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more