SubspaceId

Struct SubspaceId 

Source
pub struct SubspaceId(/* private fields */);
Expand description

The type of SubspaceIds used by Willow’25.

This is a thin wrapper around [u8; SUBSPACE_ID_WIDTH].

use willow25::prelude::*;

let subspace_id = SubspaceId::from([17; SUBSPACE_ID_WIDTH]);
assert_eq!(subspace_id.as_bytes(), &[17; 32]);

Implementations§

Source§

impl SubspaceId

Source

pub fn as_bytes(&self) -> &[u8; 32]

Returns the raw bytes that make up this subspace id.

This type deliberately does not provide implementations of AsRef, Deref or Borrow, to make it more difficult to leak information accidentally. Apologies if this is inconvenient.

Trait Implementations§

Source§

impl Clone for SubspaceId

Source§

fn clone(&self) -> SubspaceId

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 Coordinatelike<MCL, MCC, MPL, SubspaceId> for (Path, SubspaceId, Timestamp)

Source§

fn wdm_timestamp(&self) -> Timestamp

Returns the timestamp of self.
Source§

impl Coordinatelike<MCL, MCC, MPL, SubspaceId> for (Path, Timestamp, SubspaceId)

Source§

fn wdm_timestamp(&self) -> Timestamp

Returns the timestamp of self.
Source§

impl Coordinatelike<MCL, MCC, MPL, SubspaceId> for (SubspaceId, Path, Timestamp)

Source§

fn wdm_timestamp(&self) -> Timestamp

Returns the timestamp of self.
Source§

impl Coordinatelike<MCL, MCC, MPL, SubspaceId> for (SubspaceId, Timestamp, Path)

Source§

fn wdm_timestamp(&self) -> Timestamp

Returns the timestamp of self.
Source§

impl Coordinatelike<MCL, MCC, MPL, SubspaceId> for (Timestamp, Path, SubspaceId)

Source§

fn wdm_timestamp(&self) -> Timestamp

Returns the timestamp of self.
Source§

impl Coordinatelike<MCL, MCC, MPL, SubspaceId> for (Timestamp, SubspaceId, Path)

Source§

fn wdm_timestamp(&self) -> Timestamp

Returns the timestamp of self.
Source§

impl Coordinatelike<MCL, MCC, MPL, SubspaceId> for Entry

Source§

fn wdm_timestamp(&self) -> Timestamp

Returns the timestamp of self.
Source§

impl Debug for SubspaceId

Source§

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

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

impl Entrylike<MCL, MCC, MPL, NamespaceId, SubspaceId, PayloadDigest> for Entry

Source§

fn wdm_namespace_id(&self) -> &NamespaceId

Returns the namespace_id of self.
Source§

fn wdm_payload_length(&self) -> u64

Returns the payload_length of self.
Source§

fn wdm_payload_digest(&self) -> &PayloadDigest

Returns the payload_digest of self.
Source§

impl<'a> From<&'a [u8; 32]> for &'a SubspaceId

Source§

fn from(value: &'a [u8; 32]) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a SubspaceId> for &'a [u8; 32]

Source§

fn from(value: &'a SubspaceId) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut [u8; 32]> for &'a mut SubspaceId

Source§

fn from(value: &'a mut [u8; 32]) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a mut SubspaceId> for &'a mut [u8; 32]

Source§

fn from(value: &'a mut SubspaceId) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 32]> for SubspaceId

Source§

fn from(value: [u8; 32]) -> Self

Converts to this type from the input type.
Source§

impl From<SubspaceId> for [u8; 32]

Source§

fn from(value: SubspaceId) -> Self

Converts to this type from the input type.
Source§

impl GreatestElement for SubspaceId

Source§

fn greatest() -> Self

Returns the unique greatest element. Read more
Source§

fn is_greatest(&self) -> bool

Returns true if and only if self is the greatest element.
Source§

impl Hash for SubspaceId

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 Keylike<MCL, MCC, MPL, SubspaceId> for (Path, SubspaceId)

Source§

fn wdm_subspace_id(&self) -> &SubspaceId

Returns the subspace_id of self.
Source§

fn wdm_path(&self) -> &Path<MCL, MCC, MPL>

Returns the path of self.
Source§

impl Keylike<MCL, MCC, MPL, SubspaceId> for (Path, SubspaceId, Timestamp)

Source§

fn wdm_subspace_id(&self) -> &SubspaceId

Returns the subspace_id of self.
Source§

fn wdm_path(&self) -> &Path<MCL, MCC, MPL>

Returns the path of self.
Source§

impl Keylike<MCL, MCC, MPL, SubspaceId> for (Path, Timestamp, SubspaceId)

Source§

fn wdm_subspace_id(&self) -> &SubspaceId

Returns the subspace_id of self.
Source§

fn wdm_path(&self) -> &Path<MCL, MCC, MPL>

Returns the path of self.
Source§

impl Keylike<MCL, MCC, MPL, SubspaceId> for (SubspaceId, Path)

Source§

fn wdm_subspace_id(&self) -> &SubspaceId

Returns the subspace_id of self.
Source§

fn wdm_path(&self) -> &Path<MCL, MCC, MPL>

Returns the path of self.
Source§

impl Keylike<MCL, MCC, MPL, SubspaceId> for (SubspaceId, Path, Timestamp)

Source§

fn wdm_subspace_id(&self) -> &SubspaceId

Returns the subspace_id of self.
Source§

fn wdm_path(&self) -> &Path<MCL, MCC, MPL>

Returns the path of self.
Source§

impl Keylike<MCL, MCC, MPL, SubspaceId> for (SubspaceId, Timestamp, Path)

Source§

fn wdm_subspace_id(&self) -> &SubspaceId

Returns the subspace_id of self.
Source§

fn wdm_path(&self) -> &Path<MCL, MCC, MPL>

Returns the path of self.
Source§

impl Keylike<MCL, MCC, MPL, SubspaceId> for (Timestamp, Path, SubspaceId)

Source§

fn wdm_subspace_id(&self) -> &SubspaceId

Returns the subspace_id of self.
Source§

fn wdm_path(&self) -> &Path<MCL, MCC, MPL>

Returns the path of self.
Source§

impl Keylike<MCL, MCC, MPL, SubspaceId> for (Timestamp, SubspaceId, Path)

Source§

fn wdm_subspace_id(&self) -> &SubspaceId

Returns the subspace_id of self.
Source§

fn wdm_path(&self) -> &Path<MCL, MCC, MPL>

Returns the path of self.
Source§

impl Keylike<MCL, MCC, MPL, SubspaceId> for Entry

Source§

fn wdm_subspace_id(&self) -> &SubspaceId

Returns the subspace_id of self.
Source§

fn wdm_path(&self) -> &Path<MCL, MCC, MPL>

Returns the path of self.
Source§

impl LeastElement for SubspaceId

Source§

fn least() -> Self

Returns the unique least element. Read more
Source§

fn is_least(&self) -> bool

Returns true if and only if self is the least element.
Source§

impl LowerSemilattice for SubspaceId

Source§

fn greatest_lower_bound(&self, other: &Self) -> Self

Returns the greatest lower bound of self and other, i.e., the unique greatest element in the type which is less than or equal to both self and other.
Source§

impl Ord for SubspaceId

Source§

fn cmp(&self, other: &SubspaceId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for SubspaceId

Source§

fn eq(&self, other: &SubspaceId) -> 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 PartialOrd for SubspaceId

Source§

fn partial_cmp(&self, other: &SubspaceId) -> 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
Source§

impl RangeBounds<SubspaceId> for Area

Source§

fn start_bound(&self) -> Bound<&SubspaceId>

Start index bound. Read more
Source§

fn end_bound(&self) -> Bound<&SubspaceId>

End index bound. Read more
1.35.0 · Source§

fn contains<U>(&self, item: &U) -> bool
where T: PartialOrd<U>, U: PartialOrd<T> + ?Sized,

Returns true if item is contained in the range. Read more
Source§

fn is_empty(&self) -> bool
where T: PartialOrd,

🔬This is a nightly-only experimental API. (range_bounds_is_empty)
Returns true if the range contains no items. One-sided ranges (RangeFrom, etc) always return false. Read more
Source§

impl RangeBounds<SubspaceId> for Range3d

Source§

fn start_bound(&self) -> Bound<&SubspaceId>

Start index bound. Read more
Source§

fn end_bound(&self) -> Bound<&SubspaceId>

End index bound. Read more
1.35.0 · Source§

fn contains<U>(&self, item: &U) -> bool
where T: PartialOrd<U>, U: PartialOrd<T> + ?Sized,

Returns true if item is contained in the range. Read more
Source§

fn is_empty(&self) -> bool
where T: PartialOrd,

🔬This is a nightly-only experimental API. (range_bounds_is_empty)
Returns true if the range contains no items. One-sided ranges (RangeFrom, etc) always return false. Read more
Source§

impl TryPredecessor for SubspaceId

Source§

fn try_predecessor(&self) -> Option<Self>

If self has a predecessor, i.e., a unique greatest value which is strictly less than self, returns it. If there is no unique predecessor, returns None.
Source§

fn is_predecessor_of(&self, other: &Self) -> bool

Returns true iff self is the predecessor of other.
Source§

fn is_not_predecessor_of(&self, other: &Self) -> bool

Returns true iff self is not the predecessor of other.
Source§

impl TrySuccessor for SubspaceId

Source§

fn try_successor(&self) -> Option<Self>

If self has a successor, i.e., a unique least value which is strictly greater than self, returns it. If there is no unique successor, returns None.
Source§

fn is_successor_of(&self, other: &Self) -> bool

Returns true iff self is the successor of other.
Source§

fn is_not_successor_of(&self, other: &Self) -> bool

Returns true iff self is not the successor of other.
Source§

impl UpperSemilattice for SubspaceId

Source§

fn least_upper_bound(&self, other: &Self) -> Self

Returns the least upper bound of self and other, i.e., the unique least element in the type which is greater than or equal to both self and other.
Source§

impl Eq for SubspaceId

Source§

impl PredecessorExceptForLeast for SubspaceId

Source§

impl StructuralPartialEq for SubspaceId

Source§

impl SuccessorExceptForGreatest for SubspaceId

Auto Trait Implementations§

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> BoundedLowerSemilattice for T

Source§

fn greatest_lower_bound_slice(values: &[Self]) -> Self

Computes the greatest lower bound of all values in the slice. For the empty slice, this is the least element.
Source§

impl<T> BoundedUpperSemilattice for T

Source§

fn least_upper_bound_slice(values: &[Self]) -> Self

Computes the least upper bound of all values in the slice. For the empty slice, this is the greatest element.
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<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.
Source§

impl<T> BoundedLattice for T

Source§

impl<T> Lattice for T