pub struct RpcLogContext {
pub correlation_id: CorrelationId,
pub method: String,
pub txid: Option<String>,
pub address: Option<String>,
pub start_time: Instant,
}Expand description
Context for logging Bitcoin RPC operations
Fields§
§correlation_id: CorrelationIdCorrelation ID for this request
method: StringRPC method name
txid: Option<String>Optional transaction ID being operated on
address: Option<String>Optional address being queried
start_time: InstantStart time of the operation
Implementations§
Source§impl RpcLogContext
impl RpcLogContext
Sourcepub fn with_address(self, address: impl Into<String>) -> Self
pub fn with_address(self, address: impl Into<String>) -> Self
Set the address
Sourcepub fn log_request(&self, params: &str)
pub fn log_request(&self, params: &str)
Log the start of an RPC request
Sourcepub fn log_response(&self, response_size: usize)
pub fn log_response(&self, response_size: usize)
Log a successful RPC response
Trait Implementations§
Source§impl Clone for RpcLogContext
impl Clone for RpcLogContext
Source§fn clone(&self) -> RpcLogContext
fn clone(&self) -> RpcLogContext
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 RpcLogContext
impl RefUnwindSafe for RpcLogContext
impl Send for RpcLogContext
impl Sync for RpcLogContext
impl Unpin for RpcLogContext
impl UnwindSafe for RpcLogContext
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