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 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