Struct InMemorySecretStore
pub struct InMemorySecretStore {
secrets: RwLock<RawRwLock, HashMap<SecretKey, Vec<u8>>>,
}Expand description
In-memory secret store for testing.
Fields§
§secrets: RwLock<RawRwLock, HashMap<SecretKey, Vec<u8>>>Implementations§
§impl InMemorySecretStore
impl InMemorySecretStore
pub fn new() -> InMemorySecretStore
pub fn new() -> InMemorySecretStore
Create a new in-memory secret store.
pub fn add_secret(&self, key: SecretKey, value: impl Into<Vec<u8>>)
pub fn add_secret(&self, key: SecretKey, value: impl Into<Vec<u8>>)
Add a secret to the store.
pub fn add_string_secret(&self, key: SecretKey, value: impl Into<String>)
pub fn add_string_secret(&self, key: SecretKey, value: impl Into<String>)
Add a string secret to the store.
Trait Implementations§
§impl Default for InMemorySecretStore
impl Default for InMemorySecretStore
§fn default() -> InMemorySecretStore
fn default() -> InMemorySecretStore
Returns the “default value” for a type. Read more
§impl SecretStore for InMemorySecretStore
impl SecretStore for InMemorySecretStore
§fn get_secret<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<SecretValue, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySecretStore: 'async_trait,
fn get_secret<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<SecretValue, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySecretStore: 'async_trait,
Get a secret by key.
§fn secret_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<bool, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySecretStore: 'async_trait,
fn secret_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<bool, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySecretStore: 'async_trait,
Check if a secret exists.
§fn list_secrets<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecretKey>, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySecretStore: 'async_trait,
fn list_secrets<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecretKey>, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySecretStore: 'async_trait,
List available secrets (if supported).
§fn store_name(&self) -> &str
fn store_name(&self) -> &str
Get the store name for logging/debugging.
§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySecretStore: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySecretStore: 'async_trait,
Check if the store is healthy/connected.
Auto Trait Implementations§
impl !Freeze for InMemorySecretStore
impl !RefUnwindSafe for InMemorySecretStore
impl Send for InMemorySecretStore
impl Sync for InMemorySecretStore
impl Unpin for InMemorySecretStore
impl UnsafeUnpin for InMemorySecretStore
impl UnwindSafe for InMemorySecretStore
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.