pub struct FidoApi<P: CheckedPermissions>(/* private fields */);Implementations§
Source§impl<P: CheckedPermissions> FidoApi<P>
impl<P: CheckedPermissions> FidoApi<P>
Sourcepub fn create_security_key(
&self,
label: String,
color: u8,
icon: String,
) -> Result<usize, FidoError>where
P: MessageAllowed<CreateSecurityKey>,
pub fn create_security_key(
&self,
label: String,
color: u8,
icon: String,
) -> Result<usize, FidoError>where
P: MessageAllowed<CreateSecurityKey>,
Create a new Security Key with metadata. Returns the new key index, or an error if creation failed.
Sourcepub fn edit_security_key(
&self,
index: usize,
label: String,
color: u8,
icon: String,
date: u64,
) -> Result<(), FidoError>where
P: MessageAllowed<EditSecurityKey>,
pub fn edit_security_key(
&self,
index: usize,
label: String,
color: u8,
icon: String,
date: u64,
) -> Result<(), FidoError>where
P: MessageAllowed<EditSecurityKey>,
Edit a Security Key’s metadata. Blocks until the server returns the validation
outcome (EmptyLabel / DuplicateLabel are surfaced here so callers don’t need a
separate validate_label round-trip). Pass date: 0 to leave the date unchanged.
Sourcepub fn set_archived(
&self,
index: usize,
archived: bool,
) -> Result<(), FidoError>where
P: MessageAllowed<SetArchived>,
pub fn set_archived(
&self,
index: usize,
archived: bool,
) -> Result<(), FidoError>where
P: MessageAllowed<SetArchived>,
Set the archived state of a Security Key. Blocks until the server confirms; returns
FidoError::InvalidIndex if the slot doesn’t exist. Archived keys are automatically
set to live=false.
Sourcepub fn list_security_keys(&self) -> Vec<SecurityKeyView>where
P: MessageAllowed<ListSecurityKeys>,
pub fn list_security_keys(&self) -> Vec<SecurityKeyView>where
P: MessageAllowed<ListSecurityKeys>,
Synchronous snapshot of all security keys. Use at startup to populate local state
before the async SubscribeKeyChanges stream has delivered its initial event.
Sourcepub fn selected_security_key_index(&self) -> Result<Option<usize>, FidoError>where
P: MessageAllowed<GetSelectedSecurityKey>,
pub fn selected_security_key_index(&self) -> Result<Option<usize>, FidoError>where
P: MessageAllowed<GetSelectedSecurityKey>,
Get the index of the selected Security Key if any.
Sourcepub fn select_security_key(&self, index: Option<usize>)where
P: MessageAllowed<SelectSecurityKey>,
pub fn select_security_key(&self, index: Option<usize>)where
P: MessageAllowed<SelectSecurityKey>,
Select/Deselect a Security Key for Registration (fire-and-forget).