Trait simple_parse::SpRead[][src]

pub trait SpRead {
    fn inner_from_reader<R: Read + ?Sized>(
        src: &mut R,
        ctx: &mut SpCtx
    ) -> Result<Self, SpError>
    where
        Self: Sized + SpOptHints
;
unsafe fn inner_from_reader_unchecked<R: Read + ?Sized>(
        checked_bytes: *mut u8,
        src: &mut R,
        ctx: &mut SpCtx
    ) -> Result<Self, SpError>
    where
        Self: Sized + SpOptHints
; fn from_reader<R: Read + ?Sized>(src: &mut R) -> Result<Self, SpError>
    where
        Self: Sized + SpOptHints
, { ... } }

Parses Self from a source implementing Read (File,TcpStream, etc…)

This trait is most usefull when the bytes are coming from some kind of IO stream. When possible, it is recommend to use SpReadRaw instead for better performance.

Required methods

fn inner_from_reader<R: Read + ?Sized>(
    src: &mut R,
    ctx: &mut SpCtx
) -> Result<Self, SpError> where
    Self: Sized + SpOptHints
[src]

Converts bytes from a Reader into Self

This functions allows specifying endianness and count fields as opposed to using defaults with from_reader

unsafe fn inner_from_reader_unchecked<R: Read + ?Sized>(
    checked_bytes: *mut u8,
    src: &mut R,
    ctx: &mut SpCtx
) -> Result<Self, SpError> where
    Self: Sized + SpOptHints
[src]

Converts bytes from a &mut Read into Self with some assumptions on checked_bytes

Safety

This function assumes that checked_bytes points to at least Self::STATIC_SIZE bytes.

If this is implemented on a dynamic type, the implementors MUST check if count is provided. If it is provided, Self::COUNT_SIZE less bytes can be trusted from checked_bytes.

Loading content...

Provided methods

fn from_reader<R: Read + ?Sized>(src: &mut R) -> Result<Self, SpError> where
    Self: Sized + SpOptHints
[src]

Converts bytes from a &mut Read into Self

Loading content...

Implementations on Foreign Types

impl<'b> SpRead for u8[src]

impl<'b> SpRead for u16[src]

impl<'b> SpRead for u32[src]

impl<'b> SpRead for u64[src]

impl<'b> SpRead for u128[src]

impl<'b> SpRead for usize[src]

impl<'b> SpRead for i8[src]

impl<'b> SpRead for i16[src]

impl<'b> SpRead for i32[src]

impl<'b> SpRead for i64[src]

impl<'b> SpRead for i128[src]

impl<'b> SpRead for isize[src]

impl<'b> SpRead for bool[src]

impl<'b> SpRead for f32[src]

impl<'b> SpRead for f64[src]

impl<'b> SpRead for AtomicU8[src]

impl<'b> SpRead for AtomicU16[src]

impl<'b> SpRead for AtomicU32[src]

impl<'b> SpRead for AtomicU64[src]

impl<'b> SpRead for AtomicUsize[src]

impl<'b> SpRead for AtomicI8[src]

impl<'b> SpRead for AtomicI16[src]

impl<'b> SpRead for AtomicI32[src]

impl<'b> SpRead for AtomicI64[src]

impl<'b> SpRead for AtomicIsize[src]

impl<'b> SpRead for NonZeroU8[src]

impl<'b> SpRead for NonZeroU16[src]

impl<'b> SpRead for NonZeroU32[src]

impl<'b> SpRead for NonZeroU64[src]

impl<'b> SpRead for NonZeroU128[src]

impl<'b> SpRead for NonZeroUsize[src]

impl<'b> SpRead for NonZeroI8[src]

impl<'b> SpRead for NonZeroI16[src]

impl<'b> SpRead for NonZeroI32[src]

impl<'b> SpRead for NonZeroI64[src]

impl<'b> SpRead for NonZeroI128[src]

impl<'b> SpRead for NonZeroIsize[src]

impl<'b> SpRead for String[src]

impl<'b> SpRead for CString[src]

impl<'b, T: SpRead + SpOptHints> SpRead for Option<T>[src]

impl<'b, T: SpRead + SpOptHints> SpRead for Vec<T>[src]

impl<'b, T: SpRead + SpOptHints> SpRead for VecDeque<T>[src]

impl<'b, T: SpRead + SpOptHints> SpRead for LinkedList<T>[src]

impl<'b, K: SpRead + SpOptHints + Eq + Hash> SpRead for HashSet<K>[src]

impl<'b, K: SpRead + SpOptHints + Ord> SpRead for BTreeSet<K>[src]

impl<'b, K: SpRead + SpOptHints + Eq + Hash, V: SpRead + SpOptHints> SpRead for HashMap<K, V>[src]

impl<'b, K: SpRead + SpOptHints + Ord, V: SpRead + SpOptHints> SpRead for BTreeMap<K, V>[src]

impl<'b, T: SpRead + SpOptHints + Ord> SpRead for BinaryHeap<T>[src]

Loading content...

Implementors

Loading content...