pub struct Relation<T> { /* private fields */ }Implementations§
Source§impl<T> Relation<T>
impl<T> Relation<T>
pub fn new() -> Self
pub fn scene(&self) -> SceneId
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn links(&self) -> &[Link<T>]
pub fn ids(&self) -> &[LinkId]
Sourcepub fn link(
&mut self,
entities: &Entities,
from: Entity,
to: Entity,
data: T,
) -> Result<LinkId, StoreError>
pub fn link( &mut self, entities: &Entities, from: Entity, to: Entity, data: T, ) -> Result<LinkId, StoreError>
Occupied when the endpoint’s slot still lists links of an older generation.
pub fn unlink(&mut self, id: LinkId) -> Result<Link<T>, StoreError>
pub fn get(&self, id: LinkId) -> Option<&Link<T>>
pub fn get_mut(&mut self, id: LinkId) -> Option<&mut T>
pub fn outgoing(&self, from: Entity) -> Endpoints<'_> ⓘ
pub fn incoming(&self, to: Entity) -> Endpoints<'_> ⓘ
Trait Implementations§
Source§impl<T: Clone + Send + 'static> StoreField for Relation<T>
impl<T: Clone + Send + 'static> StoreField for Relation<T>
type Snapshot = RelationSnapshot<T>
fn bind(&mut self, scene: SceneId, _owner: Owner)
fn snapshot(&self) -> RelationSnapshot<T>
fn restore(&mut self, from: &RelationSnapshot<T>, scene: SceneId, _owner: Owner)
fn release(&mut self, entity: Entity, _owner: Owner)
fn boundary(&mut self, _owner: Owner)
Auto Trait Implementations§
impl<T> Freeze for Relation<T>
impl<T> RefUnwindSafe for Relation<T>where
T: RefUnwindSafe,
impl<T> Send for Relation<T>where
T: Send,
impl<T> Sync for Relation<T>where
T: Sync,
impl<T> Unpin for Relation<T>where
T: Unpin,
impl<T> UnsafeUnpin for Relation<T>
impl<T> UnwindSafe for Relation<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more