pub(crate) struct AddrVec<A: Addr, Inst> {
inner: Vec<Inst>,
_phantom: PhantomData<A>,
}Fields§
§inner: Vec<Inst>§_phantom: PhantomData<A>Implementations§
Source§impl<A: Addr, Inst> AddrVec<A, Inst>
impl<A: Addr, Inst> AddrVec<A, Inst>
Sourcepub fn get_mut(&mut self, addr: A) -> &mut Inst
pub fn get_mut(&mut self, addr: A) -> &mut Inst
Returns a mutable reference to some instance by its address addr.
Sourcepub(crate) fn insert(&mut self, instance: Inst) -> A
pub(crate) fn insert(&mut self, instance: Inst) -> A
Inserts a new instance into the current Store and returns its address.
This method should always be used to insert new instances, as it is the only safe way of creating addrs.
Sourcepub(crate) fn get_two_mut(
&mut self,
addr_one: A,
addr_two: A,
) -> Option<(&mut Inst, &mut Inst)>
pub(crate) fn get_two_mut( &mut self, addr_one: A, addr_two: A, ) -> Option<(&mut Inst, &mut Inst)>
Mutably borrows two instances by their addresses and returns those
references. In the case where both given addresses are equal, None is
returned instead.
Trait Implementations§
Auto Trait Implementations§
impl<A, Inst> Freeze for AddrVec<A, Inst>
impl<A, Inst> RefUnwindSafe for AddrVec<A, Inst>where
A: RefUnwindSafe,
Inst: RefUnwindSafe,
impl<A, Inst> Send for AddrVec<A, Inst>
impl<A, Inst> Sync for AddrVec<A, Inst>
impl<A, Inst> Unpin for AddrVec<A, Inst>
impl<A, Inst> UnwindSafe for AddrVec<A, Inst>where
A: UnwindSafe,
Inst: 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