Trait xray_lite::IntoInfallibleContext
source · pub trait IntoInfallibleContext {
type Context: Context;
// Required method
fn into_infallible(self) -> InfallibleContext<Self::Context>;
}
Expand description
Conversion into an infallible context.
You can convert Result<Context, _>
into an infallible context by using
this trait.`
use xray_lite::{
Context as _,
DaemonClient,
IntoInfallibleContext as _,
CustomNamespace,
SubsegmentContext,
};
fn main() {
let client = DaemonClient::from_lambda_env().unwrap();
let context = SubsegmentContext::from_lambda_env(client).into_infallible();
let _session = context.enter_subsegment(CustomNamespace::new("readme.example"));
}
Required Associated Types§
Required Methods§
sourcefn into_infallible(self) -> InfallibleContext<Self::Context>
fn into_infallible(self) -> InfallibleContext<Self::Context>
Converts into an infallible context.