pub struct FileAndSocketSink { /* private fields */ }Expand description
An EventSink that writes JSON-lines to a log file and a Unix socket.
The log file is opened in append mode. A background thread accepts connections on a Unix domain socket; at most one client is served at a time. If no client is connected, socket writes are silently skipped.
§Examples
use grafos_observe::file_socket_sink::FileAndSocketSink;
use std::path::Path;
let sink = FileAndSocketSink::new(
Path::new("/tmp/fabric-events.jsonl"),
Path::new("/tmp/fabric-events.sock"),
).expect("failed to create sink");Implementations§
Trait Implementations§
Source§impl EventSink for FileAndSocketSink
impl EventSink for FileAndSocketSink
Source§fn emit(&self, event: &FabricEvent)
fn emit(&self, event: &FabricEvent)
Consume an event. Implementations should not block.
Auto Trait Implementations§
impl !Freeze for FileAndSocketSink
impl !RefUnwindSafe for FileAndSocketSink
impl Send for FileAndSocketSink
impl Sync for FileAndSocketSink
impl Unpin for FileAndSocketSink
impl !UnwindSafe for FileAndSocketSink
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