Skip to main content

ExposedCache

Struct ExposedCache 

Source
pub struct ExposedCache(UniValMap<ExposedCacheNode>);
Expand description

Caches information about where in the tree exposed nodes with permission to do reads/ rites are located. ExposedCache stores this information a single location (or rather, a range of homogeneous locations) for all nodes in an allocation.

Nodes not in this map have a default ExposedCacheNode, i.e. they have no exposed children. In particular, this map remains empty (and thus consumes no memory) until the first node in the tree gets exposed.

Tuple Fields§

§0: UniValMap<ExposedCacheNode>

Implementations§

Source§

impl ExposedCache

Source

pub fn access_relatedness( &self, root: UniIndex, id: UniIndex, kind: AccessKind, is_wildcard_tree: bool, only_foreign: bool, ) -> Option<WildcardAccessRelatedness>

Returns the relatedness of a wildcard access to a node.

This function only considers a single subtree. If the current subtree does not contain any valid exposed nodes then the function return None.

  • root: The root of the subtree the node belongs to.
  • id: The id of the node.
  • kind: The kind of the wildcard access.
  • is_wildcard_tree: This nodes belongs to a wildcard subtree. This means we always treat foreign accesses as possible.
  • only_foreign: Assume the access cannot come from a local node.
Source

pub fn update_exposure( &mut self, nodes: &UniValMap<Node>, id: UniIndex, from: WildcardAccessLevel, to: WildcardAccessLevel, )

Update the tracking information of a tree, to reflect that the node specified by id is now exposed with new_exposed_as permission.

Propagates the Willard access information over the tree. This needs to be called every time the access level of an exposed node changes, to keep the state in sync with the rest of the tree.

  • from: The previous access level of the exposed node. Set to None if the node was not exposed before.
  • to: The new access level.
Source

pub fn remove(&mut self, idx: UniIndex)

Removes a node from the datastructure.

The caller needs to ensure that the node does not have any children.

Trait Implementations§

Source§

impl Clone for ExposedCache

Source§

fn clone(&self) -> ExposedCache

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 Debug for ExposedCache

Source§

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

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

impl Default for ExposedCache

Source§

fn default() -> ExposedCache

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

impl PartialEq for ExposedCache

Source§

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

Source§

impl StructuralPartialEq for ExposedCache

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

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 24 bytes