Skip to content

Commit

Permalink
Add client trait for FsInfo syscall
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Jul 24, 2024
1 parent 0a7c962 commit b454faa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion extensions/fs-info/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
#![deny(unsafe_code)]

use serde::{Deserialize, Serialize};
use trussed::{serde_extensions::Extension, types::Location, Error};
use trussed::{
serde_extensions::{Extension, ExtensionClient, ExtensionResult},
types::Location,
Error,
};

pub struct FsInfoExtension;

Expand Down Expand Up @@ -74,3 +78,11 @@ impl Extension for FsInfoExtension {
type Request = FsInfoExtensionRequest;
type Reply = FsInfoExtensionReply;
}

pub type FsInfoResult<'a, R, C> = ExtensionResult<'a, FsInfoExtension, R, C>;

pub trait FsInfoClient: ExtensionClient<FsInfoExtension> {
fn fs_info(&mut self, location: Location) -> FsInfoResult<'_, FsInfoReply, Self> {
self.extension(FsInfoRequest { location })
}
}

0 comments on commit b454faa

Please sign in to comment.