pub struct MachineFile {
pub id: String,
pub certificate: String,
pub issued: DateTime<Utc>,
pub expiry: DateTime<Utc>,
pub ttl: i32,
}Fields§
§id: String§certificate: String§issued: DateTime<Utc>§expiry: DateTime<Utc>§ttl: i32Implementations§
Source§impl MachineFile
impl MachineFile
pub fn from_cert(key: &str, content: &str) -> Result<MachineFile, Error>
pub fn verify(&self) -> Result<(), Error>
pub fn validate_ttl(&self) -> Result<(), Error>
pub fn decrypt(&self, key: &str) -> Result<MachineFileDataset, Error>
pub fn certificate(&self) -> Result<Certificate, Error>
Sourcepub fn entitlements(&self, key: &str) -> Result<Vec<Entitlement>, Error>
pub fn entitlements(&self, key: &str) -> Result<Vec<Entitlement>, Error>
Get entitlements from the machine file without making an API call Requires the decryption key and the machine file to include entitlements
Trait Implementations§
Source§impl Clone for MachineFile
impl Clone for MachineFile
Source§fn clone(&self) -> MachineFile
fn clone(&self) -> MachineFile
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 moreSource§impl Debug for MachineFile
impl Debug for MachineFile
Source§impl<'de> Deserialize<'de> for MachineFile
impl<'de> Deserialize<'de> for MachineFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MachineFile
impl RefUnwindSafe for MachineFile
impl Send for MachineFile
impl Sync for MachineFile
impl Unpin for MachineFile
impl UnwindSafe for MachineFile
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