pub struct LineBuf {
buf: [u8; 512],
len: usize,
truncated: bool,
}Expand description
1 行ぶんを組み立てるスタック上のバッファ。
ログ経路ではヒープを使わない。String を組むとアロケータのロックを
取ることになり、確保まわりの不具合を調べるためのログ自身が
その経路に依存してしまう。
入り切らない分は捨てる(切り詰めた印として末尾に … を付ける)。
ログが切れるのは困るが、行が混ざって読めなくなるよりはよい。
Fields§
§buf: [u8; 512]§len: usize§truncated: boolImplementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LineBuf
impl RefUnwindSafe for LineBuf
impl Send for LineBuf
impl Sync for LineBuf
impl Unpin for LineBuf
impl UnsafeUnpin for LineBuf
impl UnwindSafe for LineBuf
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