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

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

Constants

  • 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

  • Compares the contents of x to the ones of y,see lexicographical comparison.
  • Checks if the contents of the reader x are the ones of y.
  • Checks if the contents of needle are in haystack.
  • Hash the contents of the reader x to state.
  • 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.
  • Like io_op,but with only one reader and slice passed down to callback.
  • Checks if the contents of needle are in haystack starting from the end.
  • Checks if the first contents of the reader haystack are the ones of needle,an empty needle is always true.
  • Convert the contents of the reader into valid UTF-8 and pass it to callback,passing in None when some bytes are not.