Add write to the environment
This commit is contained in:
11
src/env/mod.rs
vendored
11
src/env/mod.rs
vendored
@@ -13,7 +13,7 @@ pub trait UserPresence {
|
||||
/// Blocks for user presence.
|
||||
///
|
||||
/// Returns an error in case of timeout or keepalive error.
|
||||
fn check(&self, cid: ChannelID) -> Result<(), Ctap2StatusCode>;
|
||||
fn check(&mut self, cid: ChannelID) -> Result<(), Ctap2StatusCode>;
|
||||
}
|
||||
|
||||
/// Describes what CTAP needs to function.
|
||||
@@ -23,6 +23,7 @@ pub trait Env {
|
||||
type Storage: Storage;
|
||||
type UpgradeStorage: UpgradeStorage;
|
||||
type FirmwareProtection: FirmwareProtection;
|
||||
type Write: core::fmt::Write;
|
||||
|
||||
fn rng(&mut self) -> &mut Self::Rng;
|
||||
fn user_presence(&mut self) -> &mut Self::UserPresence;
|
||||
@@ -38,4 +39,12 @@ pub trait Env {
|
||||
fn upgrade_storage(&mut self) -> StorageResult<Self::UpgradeStorage>;
|
||||
|
||||
fn firmware_protection(&mut self) -> &mut Self::FirmwareProtection;
|
||||
|
||||
/// Creates a write instance for debugging.
|
||||
///
|
||||
/// This API doesn't return a reference such that drop may flush. This matches the Tock
|
||||
/// environment. Non-Tock embedded environments should use the defmt feature (to be implemented
|
||||
/// using the defmt crate) and ignore this API. Non-embedded environments may either use this
|
||||
/// API or use the log feature (to be implemented using the log crate).
|
||||
fn write(&mut self) -> Self::Write;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user