pub struct Device {
pub now: Timestamp,
/* private fields */
}Expand description
What the device knows about itself. Never sent anywhere.
Fields§
§now: TimestampThe current time.
Implementations§
Source§impl Device
impl Device
Sourcepub fn new(bucket_secret: [u8; 32], now: Timestamp) -> Self
pub fn new(bucket_secret: [u8; 32], now: Timestamp) -> Self
A device with a local random secret used only for rollout buckets. Create the secret once per install and keep it on the device.
Sourcepub fn set(&mut self, attr: &str, value: impl Into<Value>) -> Result<&mut Self>
pub fn set(&mut self, attr: &str, value: impl Into<Value>) -> Result<&mut Self>
Sets an attribute (built-in or custom.*).
Sourcepub fn join_cohort(&mut self, name: &str) -> &mut Self
pub fn join_cohort(&mut self, name: &str) -> &mut Self
Adds a cohort whose signed token the user installed. Token checks are the caller’s.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Device
impl Freeze for Device
impl Move for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnsafeUnpin for Device
impl UnwindSafe for Device
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