pub struct SyThreadLocal;Expand description
A threal local syslog which is completely lockless! It can be used in signle threaded applications or with the thread_local functionality.
ⓘ
thread_local!
{
// Could add pub to make it public to whatever Foo already is public to.
static SYSLOG: RefCell<Syslog<DefaultSyslogFormatter, SyslogLocal, SyThreadLocal>> =
RefCell::new(
Syslog
::<_, _, SyThreadLocal>
.unwrap()
);
}A stream is availble via [SyStreamApi].
ⓘ
let _ = write!(SYSLOG.stream(Priority::LOG_DEBUG), "test {} 123 stream test ", d);The instances will be completly separated and have own FD.
§Generics
-
D- a SyslogDestination instance which is either: [SyslogLocal], crate::syslog_provider::SyslogFile, [crate::syslog_provider::SyslogNet], crate::syslog_provider::SyslogTls. By default aSyslogLocalis selected. -
F- a SyslogFormatter which sets the instance which would format the message.
Trait Implementations§
Source§impl Debug for SyThreadLocal
impl Debug for SyThreadLocal
Source§impl SyslogType for SyThreadLocal
impl SyslogType for SyThreadLocal
type LockItemsBase = LogItems
type LockItems = <SyThreadLocal as SyslogType>::LockItemsBase
type LockStreamBase<D: SyslogDestination> = SyslogSocketLockless<D>
type LockStream<D: SyslogDestination> = <SyThreadLocal as SyslogType>::LockStreamBase<D>
type MoveLockType = PhantomData<*const ()>
fn wrap_items(items: Self::LockItemsBase) -> Self::LockItems
fn wrap_stream<D: SyslogDestination>( stream: Self::LockStreamBase<D>, ) -> Self::LockStream<D>
Auto Trait Implementations§
impl Freeze for SyThreadLocal
impl RefUnwindSafe for SyThreadLocal
impl Send for SyThreadLocal
impl Sync for SyThreadLocal
impl Unpin for SyThreadLocal
impl UnsafeUnpin for SyThreadLocal
impl UnwindSafe for SyThreadLocal
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