pub struct DeviceDescriptionBuilder { /* private fields */ }Expand description
Builder for constructing a DeviceDescription.
This is primarily used by host implementations and custom hosts to gradually build up device descriptions with available metadata.
Implementations§
Source§impl DeviceDescriptionBuilder
impl DeviceDescriptionBuilder
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates a new builder with the device name (required).
Sourcepub fn manufacturer(self, manufacturer: impl Into<String>) -> Self
pub fn manufacturer(self, manufacturer: impl Into<String>) -> Self
Sets the manufacturer name.
Sourcepub fn device_type(self, device_type: DeviceType) -> Self
pub fn device_type(self, device_type: DeviceType) -> Self
Sets the device type.
Sourcepub fn interface_type(self, interface_type: InterfaceType) -> Self
pub fn interface_type(self, interface_type: InterfaceType) -> Self
Sets the interface type.
Sourcepub fn direction(self, direction: DeviceDirection) -> Self
pub fn direction(self, direction: DeviceDirection) -> Self
Sets the device direction.
Sourcepub fn add_extended_line(self, line: impl Into<String>) -> Self
pub fn add_extended_line(self, line: impl Into<String>) -> Self
Adds a single description line.
Sourcepub fn build(self) -> DeviceDescription
pub fn build(self) -> DeviceDescription
Builds the DeviceDescription.
Trait Implementations§
Source§impl Clone for DeviceDescriptionBuilder
impl Clone for DeviceDescriptionBuilder
Source§fn clone(&self) -> DeviceDescriptionBuilder
fn clone(&self) -> DeviceDescriptionBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeviceDescriptionBuilder
impl RefUnwindSafe for DeviceDescriptionBuilder
impl Send for DeviceDescriptionBuilder
impl Sync for DeviceDescriptionBuilder
impl Unpin for DeviceDescriptionBuilder
impl UnsafeUnpin for DeviceDescriptionBuilder
impl UnwindSafe for DeviceDescriptionBuilder
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