pub struct LicenseKey<T = String>(pub(crate) T);
Expand description
A newtype wrapping String
or &str
for the license key.
- The default value is set to
TEST_PAID_LICENSE_KEY_CONTENT
in debug mode, and empty otherwise. - The content will be redacted when printed or serialized.
Tuple Fields§
§0: T
Implementations§
source§impl<T: AsRef<str>> LicenseKey<T>
impl<T: AsRef<str>> LicenseKey<T>
fn redact_str(&self) -> &str
source§impl LicenseKey
impl LicenseKey
sourcepub fn as_ref(&self) -> LicenseKeyRef<'_>
pub fn as_ref(&self) -> LicenseKeyRef<'_>
Convert to a reference.
Trait Implementations§
source§impl<T: Clone> Clone for LicenseKey<T>
impl<T: Clone> Clone for LicenseKey<T>
source§fn clone(&self) -> LicenseKey<T>
fn clone(&self) -> LicenseKey<T>
Returns a copy 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> Deserialize<'de> for LicenseKey<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for LicenseKey<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> From<LicenseKey<&'a str>> for LicenseKey
impl<'a> From<LicenseKey<&'a str>> for LicenseKey
source§fn from(t: LicenseKeyRef<'a>) -> Self
fn from(t: LicenseKeyRef<'a>) -> Self
Converts to this type from the input type.
source§impl<T: AsRef<str>> From<LicenseKey<T>> for String
impl<T: AsRef<str>> From<LicenseKey<T>> for String
source§fn from(val: LicenseKey<T>) -> Self
fn from(val: LicenseKey<T>) -> Self
Converts to this type from the input type.
source§impl<T> From<T> for LicenseKey<T>
impl<T> From<T> for LicenseKey<T>
source§impl FromStr for LicenseKey
impl FromStr for LicenseKey
source§impl<A, B> PartialEq<LicenseKey<B>> for LicenseKey<A>
impl<A, B> PartialEq<LicenseKey<B>> for LicenseKey<A>
impl<T: Copy> Copy for LicenseKey<T>
impl<T: AsRef<str>> Eq for LicenseKey<T>
Auto Trait Implementations§
impl<T> Freeze for LicenseKey<T>where
T: Freeze,
impl<T> RefUnwindSafe for LicenseKey<T>where
T: RefUnwindSafe,
impl<T> Send for LicenseKey<T>where
T: Send,
impl<T> Sync for LicenseKey<T>where
T: Sync,
impl<T> Unpin for LicenseKey<T>where
T: Unpin,
impl<T> UnwindSafe for LicenseKey<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request