pub struct DIFInterface {
pub cache: SharedValuesCache,
/* private fields */
}Fields§
§cache: SharedValuesCacheImplementations§
Source§impl DIFInterface
impl DIFInterface
pub fn new( transceiver_id: TransceiverId, address_provider: Rc<RefCell<SelfOwnedPointerAddressProvider>>, ) -> Self
Source§impl DIFInterface
impl DIFInterface
Sourcepub fn update(
&self,
address: &PointerAddress,
update: Update,
) -> Result<UpdateReturn, DIFUpdateError>
pub fn update( &self, address: &PointerAddress, update: Update, ) -> Result<UpdateReturn, DIFUpdateError>
Updates the shared container for the given address and returns an update result
Sourcepub fn get_current_observers(
&self,
address: &PointerAddress,
source_id: TransceiverId,
) -> Result<Vec<ObserverCallback>, ValueNotFoundInCacheError>
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
Sourcepub fn apply(
&self,
callee: ValueContainer,
value: ValueContainer,
) -> Result<Option<ValueContainer>, ApplyError>
pub fn apply( &self, callee: ValueContainer, value: ValueContainer, ) -> Result<Option<ValueContainer>, ApplyError>
Executes an apply operation, applying the value to the callee.
Sourcepub fn create_pointer(
&mut self,
value: BaseSharedValueContainer,
) -> SelfOwnedPointerAddress
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.
Sourcepub fn resolve_pointer_address(
&mut self,
address: PointerAddress,
) -> Result<SharedContainer, ValueNotFoundInCacheError>
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.
pub fn has_address_with_ownership( &self, pointer_address: &PointerAddress, ownership: SharedContainerOwnership, ) -> bool
Sourcepub fn observe_pointer(
&self,
address: PointerAddress,
options: ObserveOptions,
callback: impl Fn(&Update) + 'static,
) -> Result<ObserverId, DIFObserveError>
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.
Sourcepub fn update_observer_options(
&self,
address: PointerAddress,
observer_id: ObserverId,
options: ObserveOptions,
) -> Result<(), DIFObserveError>
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.
Sourcepub fn unobserve_pointer(
&self,
address: PointerAddress,
observer_id: ObserverId,
) -> Result<(), DIFObserveError>
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§
impl !RefUnwindSafe for DIFInterface
impl !Send for DIFInterface
impl !Sync for DIFInterface
impl !UnwindSafe for DIFInterface
impl Freeze for DIFInterface
impl Unpin for DIFInterface
impl UnsafeUnpin for DIFInterface
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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