pub struct Writer { /* private fields */ }Expand description
Android log writer.
By default every write is buffer unless buffer overflow happens.
Buffered input is flushed on Drop or via manual call.
Implementations§
Source§impl Writer
impl Writer
Sourcepub const fn new_default(prio: LogPriority) -> Self
pub const fn new_default(prio: LogPriority) -> Self
Creates new instance using default tag Rust
prio- Logging priority.
Sourcepub fn new(tag: &str, prio: LogPriority) -> Self
pub fn new(tag: &str, prio: LogPriority) -> Self
Creates new instance using:
tag- Log message tag, truncated to first 23 characters.prio- Logging priority
Sourcepub const unsafe fn from_raw_parts(
tag: MaybeUninit<[u8; 24]>,
prio: LogPriority,
) -> Self
pub const unsafe fn from_raw_parts( tag: MaybeUninit<[u8; 24]>, prio: LogPriority, ) -> Self
Creates new instance with:
tag- Log message’s tag as raw C string, that must be ending with 0. It is UB to pass anything else.prio- Logging priority
Sourcepub fn flush(&mut self)
pub fn flush(&mut self)
Flushes internal buffer, if any data is available.
Namely it dumps stored data in buffer via __android_log_write.
And resets buffered length to 0.
Sourcepub fn write_data(&mut self, data: &[u8])
pub fn write_data(&mut self, data: &[u8])
Writes supplied text to the buffer.
On buffer overflow, data is logged via __android_log_write
and buffer is filled with the rest of data
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnwindSafe for Writer
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