pub struct DelegateCtx { /* private fields */ }Expand description
Implementations§
Source§impl DelegateCtx
impl DelegateCtx
Sourcepub fn read(&self) -> Vec<u8> ⓘ
pub fn read(&self) -> Vec<u8> ⓘ
Read the current context bytes.
Returns an empty Vec if no context has been written.
Sourcepub fn read_into(&self, buf: &mut [u8]) -> usize
pub fn read_into(&self, buf: &mut [u8]) -> usize
Read context into a provided buffer.
Returns the number of bytes actually read.
Sourcepub fn write(&mut self, data: &[u8]) -> bool
pub fn write(&mut self, data: &[u8]) -> bool
Write new context bytes, replacing any existing content.
Returns true on success, false on error.
Sourcepub fn get_secret_len(&self, key: &[u8]) -> Option<usize>
pub fn get_secret_len(&self, key: &[u8]) -> Option<usize>
Get the length of a secret without retrieving its value.
Returns None if the secret does not exist.
Sourcepub fn get_secret(&self, key: &[u8]) -> Option<Vec<u8>>
pub fn get_secret(&self, key: &[u8]) -> Option<Vec<u8>>
Get a secret by key.
Returns None if the secret does not exist.
Sourcepub fn set_secret(&mut self, key: &[u8], value: &[u8]) -> bool
pub fn set_secret(&mut self, key: &[u8], value: &[u8]) -> bool
Store a secret.
Returns true on success, false on error.
Sourcepub fn has_secret(&self, key: &[u8]) -> bool
pub fn has_secret(&self, key: &[u8]) -> bool
Check if a secret exists.
Sourcepub fn remove_secret(&mut self, key: &[u8]) -> bool
pub fn remove_secret(&mut self, key: &[u8]) -> bool
Remove a secret.
Returns true if the secret was removed, false if it didn’t exist.
Trait Implementations§
Source§impl Debug for DelegateCtx
impl Debug for DelegateCtx
Source§impl Default for DelegateCtx
impl Default for DelegateCtx
Source§fn default() -> DelegateCtx
fn default() -> DelegateCtx
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DelegateCtx
impl RefUnwindSafe for DelegateCtx
impl Send for DelegateCtx
impl Sync for DelegateCtx
impl Unpin for DelegateCtx
impl UnwindSafe for DelegateCtx
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