BArc

Struct BArc 

Source
pub struct BArc<T: ?Sized>(/* private fields */);

Implementations§

Source§

impl<T: ?Sized> BArc<T>
where Self: Ointer<1>,

Source

pub fn o(&self) -> bool

Get first bit and cast as bool.

Source

pub fn flip(&mut self)

Flip first bit.

Source

pub fn clone_and_flip(&self) -> Self
where Self: Clone,

Clone and flip.

Source§

impl<T> BArc<T>
where Self: Ointer<8, Pointer = Arc<T>>,

Source

pub fn new(x: T) -> Self

Source

pub fn pin(x: T) -> Pin<Self>

Source§

impl<T: ?Sized> BArc<T>

Source

pub fn downgrade(&self) -> BWeak<T>

Source

pub fn strong_count(&self) -> usize

Source

pub fn weak_count(&self) -> usize

Trait Implementations§

Source§

impl<T: ?Sized> Clone for BArc<T>
where Self: Ointer<8, Pointer = Arc<T>>, <Self as Ointer<8>>::Pointer: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: ?Sized> Debug for BArc<T>
where Self: Ointer<8, Pointer = Arc<T>>, <Self as Ointer<8>>::Pointer: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for BArc<T>
where Self: Ointer<8, Pointer = Arc<T>>, <Self as Ointer<8>>::Pointer: Default,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: ?Sized> Deref for BArc<T>
where Self: Ointer<8, Pointer = Arc<T>>, <Self as Ointer<8>>::Pointer: Deref<Target = T>,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<T: ?Sized> DerefMut for BArc<T>
where Self: Ointer<8, Pointer = Arc<T>>, <Self as Ointer<8>>::Pointer: DerefMut<Target = T>,

Source§

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

Mutably dereferences the value.
Source§

impl<T: ?Sized> Drop for BArc<T>
where Self: Ointer<8>,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T: ?Sized> From<Arc<T>> for BArc<T>

Source§

fn from(p: Arc<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: ?Sized> Hash for BArc<T>
where Self: Ointer<8, Pointer = Arc<T>>, <Self as Ointer<8>>::Pointer: Hash,

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: ?Sized> Ointer<8> for BArc<T>

Source§

type Pointer = Arc<T>

Source§

const LOW_MASK: usize = _

Source§

const HIGH_MASK: usize = _

Source§

const MIN_SIGNED: isize = _

Source§

const MAX_SIGNED: isize = _

Source§

const SHIFT_BITS: usize = _

Source§

fn get_bool(&self) -> bool

Get high N bits and return false if they are all 0.
Source§

fn get_isize(&self) -> isize

Get high N bits and cast as isize.
Source§

fn get_usize(&self) -> usize

Get high N bits and cast as usize.
Source§

fn get_ptr_as_usize(&self) -> usize

Get stored pointer and cast as usize.
Source§

fn set_bool(&mut self, b: bool)

Set high N bits all to 1 if true, all to 0 if false.
Source§

fn set_isize(&mut self, i: isize)

Set high N bits from isize.
Source§

fn set_usize(&mut self, u: usize)

Set high N bits from usize.
Source§

fn set_ptr(&mut self, p: &mut Self::Pointer)

Store pointer to low bits.
Source§

fn assert_stealable(&self)

Assert high N bits is all 0.
Source§

fn get<T: Copy>(&self) -> T
where Self: OinterGet<T, N>,

Get high N bits and cast as T.
Source§

fn set_mut<T: Copy>(&mut self, x: T)
where Self: OinterSet<T, N>,

Set high N bits from T.
Source§

fn map<T: Copy, R, F: FnOnce(T, &Self::Pointer) -> R>(&self, f: F) -> R
where Self: OinterGet<T, N>,

Map &Self as &T(from high N bits) and &Self::Pointer, then map fn f.
Source§

fn map_mut<T: Copy, R, F: FnOnce(&mut T, &mut Self::Pointer) -> R>( &mut self, f: F, ) -> R
where Self: OinterGet<T, N> + OinterSet<T, N>,

Map &mut Self as &mut T(from high N bits) and &mut Self::Pointer, map fn f, then store changes back.
Source§

impl<T: ?Sized> PartialEq for BArc<T>
where Self: Ointer<8, Pointer = Arc<T>>, <Self as Ointer<8>>::Pointer: PartialEq,

Source§

fn eq(&self, rhs: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: ?Sized> PartialOrd for BArc<T>
where Self: Ointer<8, Pointer = Arc<T>>, <Self as Ointer<8>>::Pointer: PartialOrd,

Source§

fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations§

§

impl<T> Freeze for BArc<T>
where T: ?Sized,

§

impl<T> RefUnwindSafe for BArc<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for BArc<T>
where T: Sync + Send + ?Sized,

§

impl<T> Sync for BArc<T>
where T: Sync + Send + ?Sized,

§

impl<T> Unpin for BArc<T>
where T: ?Sized,

§

impl<T> UnwindSafe for BArc<T>
where T: RefUnwindSafe + ?Sized,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<const N: usize, T, Ty> OinterGet<T, N> for Ty
where T: Copy, Ty: Ointer<N>,

Source§

fn get_high_bits(&self) -> T

Get high N bits and cast as T.
Source§

impl<const N: usize, T, Ty> OinterSet<T, N> for Ty
where T: Copy, Ty: Ointer<N>,

Source§

fn set_high_bits_mut(&mut self, x: T)

Set high N bits from T.
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.