Wrapper over a byte buffer, supporting concurrent memory access advice, where the highest priority advice wins.
This is likely to only be useful for memory mapped regions and memory mapped files in particular.
Uses an internal
Arc over shared state, so cloning the handle is
inexpensive. Each new and cloned handle starts with the implicit
MemAdvice::Normal. The shared state, a list of advisor interest counts,
is maintained as a single atomic integer, for minimal overhead. Each
MemAdvice level is allocated 10-bits or up to 1,023 MemHandle
advisors. Any advice beyond this capacity or after an error is returned
advise, may be ignored, favoring the prior highest priority
Wrap an owned instance of a byte slice buffer. Additional (atomic)
references to the underlying buffer can then be created by
Advise on access plans for the underlying memory. There may be multiple cloned handles to the same memory region, so the advice is only relayed to the operating system if it has greater priority than any other advice made via another surviving handle. On success, returns the MemAdvice as relayed, or a snapshot of the current, highest priority advice. Returns an error if the underlying system call fails.
impl<T> RefUnwindSafe for MemHandle<T> where[src]
impl<T> UnwindSafe for MemHandle<T> where[src]
type Owned = T
The resulting type after obtaining ownership.
pub fn clone_into(&self, target: &mut T)[src]
type Error = Infallible
The type returned in the event of a conversion error.