Docs.rs
  • small-fixed-array-0.4.8
    • small-fixed-array 0.4.8
    • Permalink
    • Docs.rs crate page
    • MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • GnomedDev
    • Dependencies
      • serde ^1.0.193 normal optional
      • to-arraystring ^0.2.1 normal optional
      • typesize ^0.1.3 normal optional
      • serde_json ^1 dev
    • Versions
    • 38.46% of the crate is documented
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate small_fixed_array

small_fixed_array0.4.8

  • All Items

Sections

  • Features
  • MSRV

Crate Items

  • Structs
  • Traits

Crates

  • small_fixed_array

Crate small_fixed_array

Source
Expand description

A crate for FixedArray and FixedString, types to provide a smaller memory footprint in exchange for:

  • Immutablity, FixedArray and FixedString cannot be mutated without converting back to their expanded forms.
  • Maximum length, FixedArray and FixedString have a length cap of LenT::MAX elements.

These types provide cheap conversions to Vec and String, to make up for most of these downsides, but it is still not recommended to use these collections for mutated values as you will see a performance downside.

These can be thought of as Box<[T]> and Box<str>, except the length is denoted as LenT, by default u32.

§Features

  • nightly: Speeds up FixedString::len for small strings, using portable_simd.
  • serde: Provides serde implementations for FixedArray and FixedString.
  • typesize: Provides typesize implementations for FixedArray and FixedString.

§MSRV

The Minimum Supported Rust Version of this crate is 1.70.

It is considered a breaking change to raise this.

Structs§

FixedArray
A fixed size array with length provided at creation denoted in a ValidLength, by default u32.
FixedString
A fixed size String with length provided at creation denoted in ValidLength, by default u32.

Traits§

TruncatingInto
A sealed helper trait for calling FixedArray<T>::from_vec_trunc or FixedString::from_string_trunc.
ValidLength
A sealed trait to represent valid lengths for a FixedArray.

Results

Settings
Help
    struct
    small_fixed_array::FixedString
    A fixed size String with length provided at creation …
    method
    small_fixed_array::FixedString::into_string
    FixedString<LenT> -> String
    Converts FixedString to String, this operation should be …
    method
    small_fixed_array::FixedString::to_arraystring
    &FixedString<u8> -> ToArrayString::ArrayString
    method
    small_fixed_array::FixedString::len
    &FixedString<LenT> -> LenT
    Returns the length of the FixedString.
    method
    small_fixed_array::FixedString::is_empty
    &FixedString<LenT> -> bool
    Returns if the length is equal to 0.
    method
    small_fixed_array::FixedString::extra_size
    &FixedString<LenT> -> usize
    method
    small_fixed_array::FixedString::clone
    &FixedString<LenT> -> FixedString<LenT>
    method
    small_fixed_array::FixedString::deref
    &FixedString<LenT> -> &Deref::Target
    method
    small_fixed_array::FixedString::as_ref
    &FixedString<LenT> -> &Path
    method
    small_fixed_array::FixedString::as_str
    &FixedString<LenT> -> &str
    Converts &FixedString to &str, this conversion can be …
    method
    small_fixed_array::FixedString::borrow
    &FixedString<LenT> -> &str
    method
    small_fixed_array::FixedString::eq
    &FixedString<LenT>, &String -> bool
    method
    small_fixed_array::FixedString::serialize
    &FixedString<LenT>, S -> Result
    method
    small_fixed_array::FixedString::cmp
    &FixedString<LenT>, &FixedString<LenT> -> Ordering
    method
    small_fixed_array::FixedString::fmt
    &FixedString<LenT>, &mut Formatter -> Result
    method
    small_fixed_array::FixedString::hash
    &FixedString<LenT>, &mut H -> ()
    method
    small_fixed_array::FixedString::clone_from
    &mut FixedString<LenT>, &FixedString<LenT> -> ()
    method
    small_fixed_array::FixedString::partial_cmp
    &FixedString<LenT>, &FixedString<LenT> -> Option<Ordering>
    method
    small_fixed_array::FixedString::new
    -> FixedString<LenT>
    method
    small_fixed_array::FixedString::default
    -> FixedString<LenT>
    method
    small_fixed_array::FixedString::from_string_trunc
    String -> FixedString<LenT>
    Converts a String into a FixedString, truncating if the …
    method
    small_fixed_array::FixedString::from_str_trunc
    &str -> FixedString<LenT>
    Converts a &str into a FixedString, allocating if the …
    method
    small_fixed_array::FixedString::from_static_trunc
    &str -> FixedString<LenT>
    Converts a &'static str into a FixedString.
    method
    small_fixed_array::FixedString::deserialize
    D -> Result<FixedString<LenT>>
    method
    small_fixed_array::FixedString::from_str
    &str -> Result<FixedString<LenT>, FromStr::Err>
    method
    small_fixed_array::FixedString::try_from
    Box<str> -> Result<FixedString<LenT>, TryFrom::Error>
    method
    small_fixed_array::FixedString::clone
    &FixedString<LenT> -> FixedString<LenT>