SwmrCellBuilder

Struct SwmrCellBuilder 

Source
pub struct SwmrCellBuilder<T> { /* private fields */ }
Expand description

A builder for configuring and creating a SWMR cell.

用于配置和创建 SWMR 单元的构建器。

Implementations§

Source§

impl<T: 'static> SwmrCellBuilder<T>

Source

pub fn auto_reclaim_threshold(self, threshold: Option<usize>) -> Self

Sets the threshold for automatic garbage reclamation.

When the number of retired objects exceeds this threshold, garbage collection is triggered automatically during store.

Set to None to disable automatic reclamation. Default is Some(64).

设置自动垃圾回收的阈值。 当已退休对象的数量超过此阈值时,将在 store 期间自动触发垃圾回收。 设置为 None 以禁用自动回收。 默认为 Some(64)

Source

pub fn build(self, data: T) -> SwmrCell<T>

Creates a new SWMR cell with the configured settings and initial value.

使用配置的设置和初始值创建一个新的 SWMR 单元。

Auto Trait Implementations§

§

impl<T> Freeze for SwmrCellBuilder<T>

§

impl<T> RefUnwindSafe for SwmrCellBuilder<T>
where T: RefUnwindSafe,

§

impl<T> Send for SwmrCellBuilder<T>
where T: Send,

§

impl<T> Sync for SwmrCellBuilder<T>
where T: Sync,

§

impl<T> Unpin for SwmrCellBuilder<T>
where T: Unpin,

§

impl<T> UnwindSafe for SwmrCellBuilder<T>
where T: 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.