pub struct Device<'a> { /* private fields */ }Expand description
A device: the one that recorded the file, or a sensor it used.
The creator, given to Writer::start, is the file’s file_id and
its first device_info.
use fit_encoder::{Device, Manufacturer};
let watch = Device::new(Manufacturer::DEVELOPMENT, 1)
.serial_number(42)
.software_version(123) // 1.23
.product_name("My watch");Implementations§
Source§impl<'a> Device<'a>
impl<'a> Device<'a>
Sourcepub const fn new(manufacturer: Manufacturer, product: u16) -> Self
pub const fn new(manufacturer: Manufacturer, product: u16) -> Self
A device by its manufacturer and the manufacturer’s product number.
Sourcepub const fn serial_number(self, serial_number: u32) -> Self
pub const fn serial_number(self, serial_number: u32) -> Self
Its serial number, not 0, which is “none”.
Sourcepub const fn software_version(self, hundredths: u16) -> Self
pub const fn software_version(self, hundredths: u16) -> Self
Its software version in hundredths: 123 is 1.23.
Sourcepub const fn product_name(self, name: &'a str) -> Self
pub const fn product_name(self, name: &'a str) -> Self
Its name for display, up to PRODUCT_NAME_MAX bytes, with no NUL.
Trait Implementations§
impl<'a> Copy for Device<'a>
impl<'a> Eq for Device<'a>
impl<'a> StructuralPartialEq for Device<'a>
Auto Trait Implementations§
impl<'a> Forget for Device<'a>
impl<'a> Freeze for Device<'a>
impl<'a> Move for Device<'a>
impl<'a> RefUnwindSafe for Device<'a>
impl<'a> Send for Device<'a>
impl<'a> Sync for Device<'a>
impl<'a> Unpin for Device<'a>
impl<'a> UnsafeUnpin for Device<'a>where
&'a str: UnsafeUnpin,
impl<'a> UnwindSafe for Device<'a>where
&'a str: UnwindSafe,
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