Skip to main content

DIFInterface

Struct DIFInterface 

Source
pub struct DIFInterface {
    pub cache: SharedValuesCache,
    /* private fields */
}

Fields§

§cache: SharedValuesCache

Implementations§

Source§

impl DIFInterface

Source

pub fn new( transceiver_id: TransceiverId, address_provider: Rc<RefCell<SelfOwnedPointerAddressProvider>>, ) -> Self

Source§

impl DIFInterface

Source

pub fn update( &self, address: &PointerAddress, update: Update, ) -> Result<UpdateReturn, DIFUpdateError>

Updates the shared container for the given address and returns an update result

Source

pub fn get_current_observers( &self, address: &PointerAddress, source_id: TransceiverId, ) -> Result<Vec<ObserverCallback>, ValueNotFoundInCacheError>

Returns a list of all ObserverCallbacks that are currently active for the pointer

Source

pub fn apply( &self, callee: ValueContainer, value: ValueContainer, ) -> Result<Option<ValueContainer>, ApplyError>

Executes an apply operation, applying the value to the callee.

Source

pub fn create_pointer( &mut self, value: BaseSharedValueContainer, ) -> SelfOwnedPointerAddress

Creates a new owned local pointer and stores it in memory. Returns the SelfOwnedPointerAddress of the newly created pointer.

Source

pub fn resolve_pointer_address( &mut self, address: PointerAddress, ) -> Result<SharedContainer, ValueNotFoundInCacheError>

Resolves a pointer address of a pointer that is currently in memory to its SharedContainer. Returns an error if the pointer is not found in memory.

Source

pub fn has_address_with_ownership( &self, pointer_address: &PointerAddress, ownership: SharedContainerOwnership, ) -> bool

Source

pub fn observe_pointer( &self, address: PointerAddress, options: ObserveOptions, callback: impl Fn(&Update) + 'static, ) -> Result<ObserverId, DIFObserveError>

Starts observing changes to the pointer at the given address. As long as the pointer is observed, it will not be garbage collected.

Source

pub fn update_observer_options( &self, address: PointerAddress, observer_id: ObserverId, options: ObserveOptions, ) -> Result<(), DIFObserveError>

Updates the options for an existing observer on the pointer at the given address. If the observer does not exist, an error is returned.

Source

pub fn unobserve_pointer( &self, address: PointerAddress, observer_id: ObserverId, ) -> Result<(), DIFObserveError>

Stops observing changes to the pointer at the given address. If no other references to the pointer exist, it may be garbage collected after this call.

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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, U> TypeSubset<U> for T
where U: TypeSuperset<T>,

Source§

fn is_subset_of(&self, other: &U) -> bool

Returns whether self is a subset of type