pub trait Sink: AnySync {
// Required method
fn write(
&self,
target: Option<&str>,
level: Level,
args: &Arguments<'_>,
) -> bool;
}Expand description
A log sink trait that can be installed into the log subsystem using the pipe
function and will receive all log messages.
Required Methods§
Implementations§
Source§impl dyn Sink
impl dyn Sink
pub fn is<_T>(&self) -> bool
pub fn downcast_ref<_T>(&self) -> Result<&_T, TypeMismatch>
pub fn downcast_mut<_T>(&mut self) -> Result<&mut _T, TypeMismatch>
pub fn downcast<_T>( self: Box<Self>, ) -> Result<Box<_T>, DowncastError<Box<Self>>>
pub fn downcast_rc<_T>( self: Rc<Self>, ) -> Result<Rc<_T>, DowncastError<Rc<Self>>>
pub fn downcast_arc<_T>(
self: Arc<Self>,
) -> Result<Arc<_T>, DowncastError<Arc<Self>>>where
_T: AnySync,
Self: DowncastSync<_T>,
Trait Implementations§
Source§impl<_T> Downcast<_T> for dyn Sinkwhere
_T: Any,
impl<_T> Downcast<_T> for dyn Sinkwhere
_T: Any,
fn is_type(&self) -> bool
fn downcast_ref(&self) -> Result<&T, TypeMismatch>
fn downcast_mut(&mut self) -> Result<&mut T, TypeMismatch>
fn downcast(self: Box<Self>) -> Result<Box<T>, DowncastError<Box<Self>>>
fn downcast_rc(self: Rc<Self>) -> Result<Rc<T>, DowncastError<Rc<Self>>>
Source§impl<_T> DowncastSync<_T> for dyn Sinkwhere
_T: AnySync,
impl<_T> DowncastSync<_T> for dyn Sinkwhere
_T: AnySync,
fn downcast_arc(self: Arc<Self>) -> Result<Arc<T>, DowncastError<Arc<Self>>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".