pub struct ServerClient { /* private fields */ }Expand description
Client for communicating with the device gateway.
Implementations§
Source§impl ServerClient
impl ServerClient
pub fn new(base_url: &str, api_key: Option<&str>, device_id: &str) -> Self
Sourcepub fn checkin(
&self,
config_hash: &str,
compliance_summary: Option<ComplianceSummary>,
printer: &Printer,
) -> Result<CheckinResponse>
pub fn checkin( &self, config_hash: &str, compliance_summary: Option<ComplianceSummary>, printer: &Printer, ) -> Result<CheckinResponse>
Check in with the device gateway, reporting current config hash and optional compliance summary.
Sourcepub fn report_drift(
&self,
drifts: &[SystemDrift],
printer: &Printer,
) -> Result<()>
pub fn report_drift( &self, drifts: &[SystemDrift], printer: &Printer, ) -> Result<()>
Report drift events to the device gateway.
Sourcepub fn enroll(
&self,
bootstrap_token: &str,
printer: &Printer,
) -> Result<EnrollResponse>
pub fn enroll( &self, bootstrap_token: &str, printer: &Printer, ) -> Result<EnrollResponse>
Enroll this device with the device gateway using a bootstrap token. Returns the enrollment response including the permanent device API key.
Sourcepub fn enroll_info(&self) -> Result<EnrollInfoResponse>
pub fn enroll_info(&self) -> Result<EnrollInfoResponse>
Query the server’s enrollment method (token or key).
Sourcepub fn request_challenge(
&self,
username: &str,
printer: &Printer,
) -> Result<ChallengeResponse>
pub fn request_challenge( &self, username: &str, printer: &Printer, ) -> Result<ChallengeResponse>
Request an enrollment challenge from the server (key-based enrollment).
Sourcepub fn submit_verification(
&self,
challenge_id: &str,
signature: &str,
key_type: &str,
printer: &Printer,
) -> Result<EnrollResponse>
pub fn submit_verification( &self, challenge_id: &str, signature: &str, key_type: &str, printer: &Printer, ) -> Result<EnrollResponse>
Submit a signed challenge for verification (key-based enrollment).
Sourcepub fn from_credential(cred: &DeviceCredential) -> Self
pub fn from_credential(cred: &DeviceCredential) -> Self
Create a client from a stored device credential.
Auto Trait Implementations§
impl Freeze for ServerClient
impl RefUnwindSafe for ServerClient
impl Send for ServerClient
impl Sync for ServerClient
impl Unpin for ServerClient
impl UnsafeUnpin for ServerClient
impl UnwindSafe for ServerClient
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