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§

source

type Context: Context

Underlying context type.

Required Methods§

source

fn into_infallible(self) -> InfallibleContext<Self::Context>

Converts into an infallible context.

Implementations on Foreign Types§

source§

impl<T, E> IntoInfallibleContext for Result<T, E>
where T: Context,

Implementors§