Struct syslog_rs::unsafe_cell::UnsafeReadOnlyCell
source · pub struct UnsafeReadOnlyCell<T: Send> { /* private fields */ }Implementations§
source§impl<T: Send> UnsafeReadOnlyCell<T>
impl<T: Send> UnsafeReadOnlyCell<T>
sourcepub unsafe fn new_uninitialized(title: &'static str) -> UnsafeReadOnlyCell<T>
pub unsafe fn new_uninitialized(title: &'static str) -> UnsafeReadOnlyCell<T>
Creates new unititialized Cell. A contained type must implement Send and maybe Sync
Arguments
title- is a label which used to help in panic diagnostic.
Returns
- A UnsafeReadOnlyCell of type
. Never panics
Example
#[macro_use] extern crate lazy_static;
use syslog_rs::UnsafeReadOnlyCell;
struct Syslog{}
lazy_static! {
static ref SYSLOG: UnsafeReadOnlyCell<Syslog> =
unsafe { UnsafeReadOnlyCell::new_uninitialized("a_label") };
}