Struct xray_lite::SubsegmentContext
source · pub struct SubsegmentContext<C> { /* private fields */ }
Expand description
Context as a subsegment of an existing segment.
Implementations§
source§impl<C> SubsegmentContext<C>
impl<C> SubsegmentContext<C>
sourcepub fn from_lambda_env(client: C) -> Result<Self>
pub fn from_lambda_env(client: C) -> Result<Self>
Creates a new context from the Lambda environment variable.
The following environment variable must be set:
_X_AMZN_TRACE_ID
: AWS X-Ray trace ID
Please refer to the AWS documentation for more details.
sourcepub fn with_name_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_name_prefix(self, prefix: impl Into<String>) -> Self
Updates the context with a given name prefix.
The name prefix is prepended to the name of every custom subsegment.
Only subsegments associated with
CustomNamespace
are affected.
Trait Implementations§
source§impl<C: Clone> Clone for SubsegmentContext<C>
impl<C: Clone> Clone for SubsegmentContext<C>
source§fn clone(&self) -> SubsegmentContext<C>
fn clone(&self) -> SubsegmentContext<C>
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<C> Context for SubsegmentContext<C>where
C: Client,
impl<C> Context for SubsegmentContext<C>where
C: Client,
Auto Trait Implementations§
impl<C> RefUnwindSafe for SubsegmentContext<C>where
C: RefUnwindSafe,
impl<C> Send for SubsegmentContext<C>where
C: Send,
impl<C> Sync for SubsegmentContext<C>where
C: Sync,
impl<C> Unpin for SubsegmentContext<C>where
C: Unpin,
impl<C> UnwindSafe for SubsegmentContext<C>where
C: 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