pub struct DeviceContext {
pub device_id: String,
pub protocol: String,
pub trace: TraceContext,
}Expand description
Device context for device-specific operations.
Fields§
§device_id: StringDevice ID.
protocol: StringProtocol.
trace: TraceContextBase trace context.
Implementations§
Source§impl DeviceContext
impl DeviceContext
Sourcepub fn new(
device_id: impl Into<String>,
protocol: impl Into<String>,
) -> DeviceContext
pub fn new( device_id: impl Into<String>, protocol: impl Into<String>, ) -> DeviceContext
Create a new device context.
Sourcepub fn with_trace(
device_id: impl Into<String>,
protocol: impl Into<String>,
trace: TraceContext,
) -> DeviceContext
pub fn with_trace( device_id: impl Into<String>, protocol: impl Into<String>, trace: TraceContext, ) -> DeviceContext
Create with an existing trace context.
Sourcepub fn request_id(&self) -> &str
pub fn request_id(&self) -> &str
Get the request ID.
Sourcepub fn child(&self) -> DeviceContext
pub fn child(&self) -> DeviceContext
Create a child context for a sub-operation.
Trait Implementations§
Source§impl Clone for DeviceContext
impl Clone for DeviceContext
Source§fn clone(&self) -> DeviceContext
fn clone(&self) -> DeviceContext
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for DeviceContext
impl RefUnwindSafe for DeviceContext
impl Send for DeviceContext
impl Sync for DeviceContext
impl Unpin for DeviceContext
impl UnsafeUnpin for DeviceContext
impl UnwindSafe for DeviceContext
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more