pub struct StdoutClient { /* private fields */ }Implementations§
Source§impl StdoutClient
impl StdoutClient
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new StdoutClient with the default writer (stdout).
§Example
use otlp_stdout_client::StdoutClient;
let client = StdoutClient::new();Sourcepub fn new_with_writer<W>(writer: W) -> Self
pub fn new_with_writer<W>(writer: W) -> Self
Creates a new StdoutClient with a custom writer.
This method allows you to specify an alternative writer, such as a file or an in-memory buffer.
§Arguments
writer- Any writer implementingWrite + Send + Sync + 'static.
§Example
use std::fs::File;
use otlp_stdout_client::StdoutClient;
// Using a file as the writer
let file = File::create("output.log").unwrap();
let client = StdoutClient::new_with_writer(file);Trait Implementations§
Source§impl Debug for StdoutClient
impl Debug for StdoutClient
Source§impl Default for StdoutClient
impl Default for StdoutClient
Source§impl HttpClient for StdoutClient
impl HttpClient for StdoutClient
Implements the HttpClient trait for StdoutClient.
This implementation allows the StdoutClient to be used as an HTTP client
for sending OTLP (OpenTelemetry Protocol) data. It processes the request body
and writes it to stdout in a JSON format suitable for log parsing.
The send method handles both JSON and non-JSON payloads, formatting them
appropriately for stdout output.
Auto Trait Implementations§
impl !Freeze for StdoutClient
impl RefUnwindSafe for StdoutClient
impl Send for StdoutClient
impl Sync for StdoutClient
impl Unpin for StdoutClient
impl UnwindSafe for StdoutClient
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