Skip to main content

Options

Struct Options 

Source
pub struct Options<A>
where A: Allocator,
{ /* private fields */ }
Available on non-crate feature tests_loom only.
Expand description

Construction-time options for new.

Wraps the allocator-specific options so the same new signature works for every Allocator impl. Use Options::builder to build one explicitly, or Options::global_mlocked for the common global + mlock case.

Implementations§

Source§

impl<A> Options<A>
where A: Allocator,

Source

pub fn builder() -> OptionsBuilder<A>

Create an instance of Options using the builder syntax

Source§

impl Options<GlobalAllocator>

Source

pub fn global_mlocked() -> Self

Convenience shorthand for the common case: the global allocator with mlock enabled.

Auto Trait Implementations§

§

impl<A> Freeze for Options<A>
where <A as Allocator>::Options: Freeze,

§

impl<A> RefUnwindSafe for Options<A>

§

impl<A> Send for Options<A>
where <A as Allocator>::Options: Send,

§

impl<A> Sync for Options<A>
where <A as Allocator>::Options: Sync,

§

impl<A> Unpin for Options<A>
where <A as Allocator>::Options: Unpin,

§

impl<A> UnsafeUnpin for Options<A>
where <A as Allocator>::Options: UnsafeUnpin,

§

impl<A> UnwindSafe for Options<A>
where <A as Allocator>::Options: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.