pub struct EasyMmap<'a, T> { /* private fields */ }
Expand description

The main abstraction over the mmap crate. Owns a memory map and provides simplified and safe access to this memory region. Also provides some additional features such as iterators over the data.

Implementations

How many elements can be stored in the memory map.

Returns a read-only iterator over the elements of the memory map.

Returns a mutable iterator over the elements of the memory map.

Returns a parallel iterator over the elements of the memory map.

Returns a mutable parallel iterator over the elements of the memory map.

Returns a read-only slice of the memory map data.

Returns a mutable slice of the memory map data.

Convenience method for filling the memory map with a custom function Example:

let mut mmap = easy_mmap::EasyMmapBuilder::new()
                           .readable()
                           .writable()
                           .capacity(5)
                           .build();

mmap.fill(|i| i as u32);
assert_eq!(mmap.get_data_as_slice(), &[0, 1, 2, 3, 4]);

Trait Implementations

The structure can be indexed similarly to an array. Example:

let mut mmap = easy_mmap::EasyMmapBuilder::new()
                    .options(&[
                        mmap::MapOption::MapWritable,
                        mmap::MapOption::MapReadable,
                    ])
                    .capacity(10)
                    .build();
mmap[0] = 1;
println!("{}", mmap[0]);

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The structure can be indexed an array or slice. See the Index trait for an example.

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.