Crate io_interner

Source
Expand description

A simple crate implementing a struct wrapping a reader and writer that’s used to create readers to unique data.

Structs§

IOInterner
A struct wrapping a Mutex<T> used for storing and retrieving data thought readers.
IOObj
A struct generated by [IOEntry::get_object].
IOPos
Struct stating which data IOObj will read from the IOInterner internal IO object.

Constants§

BUF_LEN
Internal buffer length used in many free functions of this crate,put here if in the future some way of create it at compile time it’s implemented,only thinkable way it’s option_env!("IOINTERNER_BUF_LEN").and_then(|e| e.trim().parse().ok()).unwrap_or(512) but, except for option_env! and Option::{and_then, unwrap_or},cannot be put into a constant.

Functions§

cmp
Compares the contents of x to the ones of y,see lexicographical comparison.
eq
Checks if the contents of the reader x are the ones of y.
find
Checks if the contents of needle are in haystack.
hash
Hash the contents of the reader x to state.
io_op
Pass to callback slices with lenght up to 512 contained in both readers until either one reach EOF and returns None or when callback returns Some,that case this function will return it.
io_unary_op
Like io_op,but with only one reader and slice passed down to callback.
rfind
Checks if the contents of needle are in haystack starting from the end.
starts_with
Checks if the first contents of the reader haystack are the ones of needle,an empty needle is always true.
to_utf8
Convert the contents of the reader into valid UTF-8 and pass it to callback,passing in None when some bytes are not.