pub struct TransportKey(/* private fields */);Expand description
Configured transport key (e.g. "primary", "fallback").
End-user code should use Self::new or std::str::FromStr for
values originating outside trusted code paths.
Implementations§
Source§impl TransportKey
impl TransportKey
Sourcepub fn new(value: impl Into<String>) -> Result<Self, StringNewtypeError>
pub fn new(value: impl Into<String>) -> Result<Self, StringNewtypeError>
Construct after validating the input.
§Errors
Returns $crate::StringNewtypeError if the value is
empty, exceeds STRING_NEWTYPE_MAX_BYTES, or contains
NUL, CR/LF, or non-tab control characters.
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consume the newtype and return its string value.
Source§impl TransportKey
impl TransportKey
Sourcepub fn new_unchecked(value: impl Into<String>) -> Self
pub fn new_unchecked(value: impl Into<String>) -> Self
Construct without validating.
Reserved for trusted inputs (e.g. internal constants in
trusted code paths). Prefer Self::new or
std::str::FromStr for any value that originated
outside your own code.
This constructor exists only because the type was
declared via the @unchecked matcher arm of
[crate::string_newtype!]; the default arm omits it.
Trait Implementations§
Source§impl AsRef<str> for TransportKey
impl AsRef<str> for TransportKey
Source§impl Clone for TransportKey
impl Clone for TransportKey
Source§fn clone(&self) -> TransportKey
fn clone(&self) -> TransportKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransportKey
impl Debug for TransportKey
Source§impl<'de> Deserialize<'de> for TransportKey
impl<'de> Deserialize<'de> for TransportKey
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>,
Source§impl Display for TransportKey
impl Display for TransportKey
impl Eq for TransportKey
Source§impl From<TransportKey> for String
impl From<TransportKey> for String
Source§fn from(value: TransportKey) -> Self
fn from(value: TransportKey) -> Self
Source§impl FromStr for TransportKey
impl FromStr for TransportKey
Source§impl Hash for TransportKey
impl Hash for TransportKey
Source§impl JsonSchema for TransportKey
impl JsonSchema for TransportKey
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(_generator: &mut SchemaGenerator) -> Schema
fn json_schema(_generator: &mut SchemaGenerator) -> Schema
Source§impl PartialEq for TransportKey
impl PartialEq for TransportKey
Source§impl Serialize for TransportKey
impl Serialize for TransportKey
impl StructuralPartialEq for TransportKey
Source§impl TryFrom<&str> for TransportKey
impl TryFrom<&str> for TransportKey
Auto Trait Implementations§
impl Freeze for TransportKey
impl RefUnwindSafe for TransportKey
impl Send for TransportKey
impl Sync for TransportKey
impl Unpin for TransportKey
impl UnsafeUnpin for TransportKey
impl UnwindSafe for TransportKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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 moreimpl<T> MaybeSend for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> RuntimeBound for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> ToEcoString for T
impl<T> ToEcoString for T
Source§fn to_eco_string(&self) -> EcoString
fn to_eco_string(&self) -> EcoString
EcoString.Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.