pub use Backend;
pub use BackendType;
pub use LzfseEncoder;
pub use MatchUnit;
pub use LzfseRingEncoder;
pub use LzfseWriter;
pub use LzfseWriterBytes;
use io;
/// Encode `src` into `dst` returning the number of bytes written into `dst`.
///
/// Due to internal mechanics `src` is cannot exceed `i32::MAX` bytes in length.
///
/// This is a convenience method that constructs a temporary [LzfseEncoder] instance and then calls
/// [encode_bytes](LzfseEncoder::encode_bytes). For multiple invocations, creating and reusing a
/// [LzfseEncoder] instance is more efficient.
///
/// # Errors
///
/// * [ErrorKind::Other](std::io::ErrorKind) in case of `src` or `dst` buffer overflow.
///
/// # Aborts
///
/// With limited system memory [Vec] may abort when attempting to allocate sufficient memory.
/// This issue will be resolved in future releases when [try_reserve()](Vec::try_reserve) is
/// stabilized.
///
/// # Examples
///
/// ```
/// use std::io;
///
/// fn main() -> io::Result<()> {
/// let mut enc = Vec::default();
/// let n_bytes = lzfse_rust::encode_bytes(b"test", &mut enc)?;
/// assert_eq!(n_bytes, 16);
/// // "test" string encoded.
/// assert_eq!(enc, &[0x62, 0x76, 0x78, 0x2d, 0x04, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73, 0x74,
/// 0x62, 0x76, 0x78, 0x24]);
/// Ok(())
/// }
/// ```