pub struct CorrelationId(/* private fields */);Expand description
Correlation identifier carried end-to-end from queue to transport.
Available to adapter-specific typed options when a provider has a
natural slot for it. Validated on construction with the same rules as
IdempotencyKey.
new_unchecked is available, declared via the @unchecked
matcher arm. See IdempotencyKey for guidance.
Implementations§
Source§impl CorrelationId
impl CorrelationId
Sourcepub fn new(
value: impl Into<String>,
) -> Result<CorrelationId, StringNewtypeError>
pub fn new( value: impl Into<String>, ) -> Result<CorrelationId, 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 CorrelationId
impl CorrelationId
Sourcepub fn new_unchecked(value: impl Into<String>) -> CorrelationId
pub fn new_unchecked(value: impl Into<String>) -> CorrelationId
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 CorrelationId
impl AsRef<str> for CorrelationId
Source§impl Clone for CorrelationId
impl Clone for CorrelationId
Source§fn clone(&self) -> CorrelationId
fn clone(&self) -> CorrelationId
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 CorrelationId
impl Debug for CorrelationId
Source§impl<'de> Deserialize<'de> for CorrelationId
impl<'de> Deserialize<'de> for CorrelationId
Source§fn deserialize<D>(
deserializer: D,
) -> Result<CorrelationId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CorrelationId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for CorrelationId
impl Display for CorrelationId
impl Eq for CorrelationId
Source§impl FromStr for CorrelationId
impl FromStr for CorrelationId
Source§type Err = StringNewtypeError
type Err = StringNewtypeError
Source§fn from_str(s: &str) -> Result<CorrelationId, <CorrelationId as FromStr>::Err>
fn from_str(s: &str) -> Result<CorrelationId, <CorrelationId as FromStr>::Err>
s to return a value of this type. Read moreSource§impl Hash for CorrelationId
impl Hash for CorrelationId
Source§impl JsonSchema for CorrelationId
impl JsonSchema for CorrelationId
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 CorrelationId
impl PartialEq for CorrelationId
Source§impl Serialize for CorrelationId
impl Serialize for CorrelationId
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for CorrelationId
Source§impl TryFrom<&str> for CorrelationId
impl TryFrom<&str> for CorrelationId
Source§type Error = StringNewtypeError
type Error = StringNewtypeError
Source§fn try_from(
value: &str,
) -> Result<CorrelationId, <CorrelationId as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<CorrelationId, <CorrelationId as TryFrom<&str>>::Error>
Source§impl TryFrom<String> for CorrelationId
impl TryFrom<String> for CorrelationId
Source§type Error = StringNewtypeError
type Error = StringNewtypeError
Source§fn try_from(
value: String,
) -> Result<CorrelationId, <CorrelationId as TryFrom<String>>::Error>
fn try_from( value: String, ) -> Result<CorrelationId, <CorrelationId as TryFrom<String>>::Error>
Auto Trait Implementations§
impl Freeze for CorrelationId
impl RefUnwindSafe for CorrelationId
impl Send for CorrelationId
impl Sync for CorrelationId
impl Unpin for CorrelationId
impl UnsafeUnpin for CorrelationId
impl UnwindSafe for CorrelationId
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.