pub struct SessionId(/* private fields */);Expand description
Remote agent session ID.
Session IDs are acquired when registering as a remote agent with the Datadog Agent. This session ID must be provided when refreshing a remote agent’s registration, as well as when streaming configuration updates. To ease passing this in the necessary format, and with the required validation, this struct provides a type-safe to carry around the session ID compared to a raw string.
Implementations§
Source§impl SessionId
impl SessionId
Sourcepub fn new(session_id: &str) -> Result<Self, GenericError>
pub fn new(session_id: &str) -> Result<Self, GenericError>
Creates a new SessionId from the given string.
§Errors
If the given string isn’t valid ASCII, an error is returned.
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns a reference to the string representation of the session ID.
Sourcepub fn to_grpc_header_value(&self) -> MetadataValue<Ascii>
pub fn to_grpc_header_value(&self) -> MetadataValue<Ascii>
Returns the session ID as a metadata header value.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SessionId
impl RefUnwindSafe for SessionId
impl Send for SessionId
impl Sync for SessionId
impl Unpin for SessionId
impl UnwindSafe for SessionId
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> 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> 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::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Stringable for Twhere
T: Display,
impl<T> Stringable for Twhere
T: Display,
Converts the given value to a
SharedString.Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Instruments this type by attaching the given resource group token, returning a
Tracked wrapper. Read moreSource§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Instruments this type by attaching the current resource group, returning a
Tracked wrapper. Read more