Crate contiguous_mem

Source
Expand description

contiguous_mem streamlines storage and management of data stored in contiguous blocks of memory.

§Implementations

Primary interface of the crate is the ContiguousMemoryStorage structure which is re-exported under following type aliases with specified implementation details flag:

See individual items for usage examples, as well as project examples directory.

§Features

  • no_std - enables no_std dependencies for atomics, mutexes and rwlocks
  • debug - enables derive(Debug) on structures unrelated to error handling
  • ptr_metadata <nightly> - allows casting references into dyn Trait
  • error_in_core <nightly> - enables support for core::error::Error in no_std environment

§Contributions

Contributions are welcome, feel free to create an issue or a pull request.

All contributions to the project are licensed under the Zlib/MIT/Apache 2.0 license unless you explicitly state otherwise.

§License

This project is licensed under Zlib, MIT, or Apache-2.0 license, choose whichever suits you most.

Re-exports§

pub use refs::CERef;
pub use refs::ContiguousEntryRef;
pub use refs::SCERef;
pub use refs::SyncContiguousEntryRef;

Modules§

error
Errors produced by the crate.
refs
Returned reference types and read/write guards.

Structs§

ByteRange
Represents a range of bytes in AllocationTracker and ContiguousMemoryStorage.
ContiguousMemoryStorage
A memory container for efficient allocation and storage of contiguous data.
ImplConcurrent
Thread-safe implementation utilizing mutexes and locks to prevent data races.
ImplDefault
Implementation that’s not thread-safe but performs faster as it avoids mutexes and locks.
ImplUnsafe
Implementation which provides direct (unsafe) access to stored entries.

Functions§

static_metadataptr_metadata
Returns Pointee metadata for provided pair of struct S and some unsized type (e.g. a trait) T.

Type Aliases§

ContiguousMemory
Alias for ContiguousMemoryStorage that uses default implementation.
SyncContiguousMemory
Alias for ContiguousMemoryStorage that uses concurrent implementation.
UnsafeContiguousMemory
Alias for ContiguousMemoryStorage that uses unsafe implementation.