Struct std::io::Initializer
pub struct Initializer(_);
A type used to conditionally initialize buffers passed to Read
methods.
Implementations
impl Initializer
pub fn zeroing() -> Initializer
Returns a new Initializer
which will zero out buffers.
pub unsafe fn nop() -> Initializer
Returns a new Initializer
which will not zero out buffers.
Safety
This may only be called by Read
ers which guarantee that they will not read from buffers passed to Read
methods, and that the return value of the method accurately reflects the number of bytes that have been written to the head of the buffer.
pub fn should_initialize(&self) -> bool
Indicates if a buffer should be initialized.
pub fn initialize(&self, buf: &mut [u8])
Initializes a buffer if necessary.
Trait Implementations
impl Debug for Initializer
Auto Trait Implementations
impl RefUnwindSafe for Initializer
impl Send for Initializer
impl Sync for Initializer
impl Unpin for Initializer
impl UnwindSafe for Initializer
Blanket Implementations
impl<T> From<T> for T
pub fn from(t: T) -> T
Performs the conversion.
pub fn into(self) -> U
Performs the conversion.
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
Performs the conversion.
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
Performs the conversion.
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/io/struct.Initializer.html