pub enum MaybeSecret<T: Zeroize> {
Secret(String),
Plain(Zeroizing<T>),
}
Expand description
A type that is either a reference to a secret, serialized as
a URI string like secrets://
Variants§
Implementations§
Source§impl<T: Zeroize> MaybeSecret<T>
impl<T: Zeroize> MaybeSecret<T>
Trait Implementations§
Source§impl<T: Clone + Zeroize> Clone for MaybeSecret<T>
impl<T: Clone + Zeroize> Clone for MaybeSecret<T>
Source§fn clone(&self) -> MaybeSecret<T>
fn clone(&self) -> MaybeSecret<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de, T: DeserializeOwned + FromStr + Zeroize> Deserialize<'de> for MaybeSecret<T>
impl<'de, T: DeserializeOwned + FromStr + Zeroize> Deserialize<'de> for MaybeSecret<T>
Source§fn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Serialize + Zeroize + JsonSchema> JsonSchema for MaybeSecret<T>
impl<T: Serialize + Zeroize + JsonSchema> JsonSchema for MaybeSecret<T>
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn json_schema(_gen: &mut SchemaGenerator) -> Schema
fn json_schema(_gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl<T: Zeroize> Zeroize for MaybeSecret<T>
impl<T: Zeroize> Zeroize for MaybeSecret<T>
impl<T: Eq + Zeroize> Eq for MaybeSecret<T>
impl<T: Zeroize> StructuralPartialEq for MaybeSecret<T>
Auto Trait Implementations§
impl<T> Freeze for MaybeSecret<T>where
T: Freeze,
impl<T> RefUnwindSafe for MaybeSecret<T>where
T: RefUnwindSafe,
impl<T> Send for MaybeSecret<T>where
T: Send,
impl<T> Sync for MaybeSecret<T>where
T: Sync,
impl<T> Unpin for MaybeSecret<T>where
T: Unpin,
impl<T> UnwindSafe for MaybeSecret<T>where
T: UnwindSafe,
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