Skip to main content

FakeEntityConverter

Struct FakeEntityConverter 

Source
pub struct FakeEntityConverter;
Expand description

No-op converter that always succeeds with entity ID 0; useful in test contexts where real mapping is not needed.

Trait Implementations§

Source§

impl LocalEntityAndGlobalEntityConverter for FakeEntityConverter

Source§

fn global_entity_to_host_entity( &self, _: &GlobalEntity, ) -> Result<HostEntity, EntityDoesNotExistError>

Returns the HostEntity for global_entity if one is registered, or an error otherwise.
Source§

fn global_entity_to_remote_entity( &self, _: &GlobalEntity, ) -> Result<RemoteEntity, EntityDoesNotExistError>

Returns the RemoteEntity for global_entity if one is registered, or an error otherwise.
Source§

fn global_entity_to_owned_entity( &self, _global_entity: &GlobalEntity, ) -> Result<OwnedLocalEntity, EntityDoesNotExistError>

Returns the OwnedLocalEntity (host or remote) for global_entity, or an error if not found.
Source§

fn host_entity_to_global_entity( &self, _: &HostEntity, ) -> Result<GlobalEntity, EntityDoesNotExistError>

Returns the GlobalEntity for a dynamic host_entity, or an error if not found.
Source§

fn static_host_entity_to_global_entity( &self, _: &HostEntity, ) -> Result<GlobalEntity, EntityDoesNotExistError>

Returns the GlobalEntity for a static host_entity, or an error if not found.
Source§

fn remote_entity_to_global_entity( &self, _: &RemoteEntity, ) -> Result<GlobalEntity, EntityDoesNotExistError>

Returns the GlobalEntity for remote_entity, or an error if not found.
Source§

fn apply_entity_redirect(&self, entity: &OwnedLocalEntity) -> OwnedLocalEntity

Returns the current redirect target for entity, or entity unchanged if no redirect is installed.
Source§

fn owned_entity_to_global_entity( &self, owned_entity: &OwnedLocalEntity, ) -> Result<GlobalEntity, EntityDoesNotExistError>

Returns the GlobalEntity for owned_entity, dispatching to the appropriate host or remote lookup.
Source§

impl LocalEntityAndGlobalEntityConverterMut for FakeEntityConverter

Source§

fn get_or_reserve_entity( &mut self, _global_entity: &GlobalEntity, ) -> Result<OwnedLocalEntity, EntityDoesNotExistError>

Looks up the local entity for global_entity, reserving a new host slot if none exists yet.

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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V