pub struct EntityList<T> { /* private fields */ }Implementations§
Source§impl<T> EntityList<T>
impl<T> EntityList<T>
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new, empty EntityList
Sourcepub fn front(&self) -> EntityListCursor<'_, T>
pub fn front(&self) -> EntityListCursor<'_, T>
Get an EntityListCursor pointing to the first entity in the list, or the null object if the list is empty
Sourcepub fn back(&self) -> EntityListCursor<'_, T>
pub fn back(&self) -> EntityListCursor<'_, T>
Get an EntityListCursor pointing to the last entity in the list, or the null object if the list is empty
Sourcepub fn iter(&self) -> EntityListIter<'_, T> ⓘ
pub fn iter(&self) -> EntityListIter<'_, T> ⓘ
Get an iterator over the entities in this list
The iterator returned produces EntityRefs for each item in the list, with their lifetime bound to the list itself, not the iterator.
Sourcepub unsafe fn cursor_from_ptr(
&self,
ptr: UnsafeIntrusiveEntityRef<T>,
) -> EntityListCursor<'_, T>
pub unsafe fn cursor_from_ptr( &self, ptr: UnsafeIntrusiveEntityRef<T>, ) -> EntityListCursor<'_, T>
Get a cursor to the item pointed to by ptr.
§Safety
This function may only be called when it is known that ptr refers to an entity which is
linked into this list. This operation will panic if the entity is not linked into any list,
and may result in undefined behavior if the operation is linked into a different list.
Source§impl<T: EntityListItem> EntityList<T>
impl<T: EntityListItem> EntityList<T>
Sourcepub unsafe fn cursor_mut_from_ptr(
&mut self,
ptr: UnsafeIntrusiveEntityRef<T>,
) -> EntityListCursorMut<'_, T>
pub unsafe fn cursor_mut_from_ptr( &mut self, ptr: UnsafeIntrusiveEntityRef<T>, ) -> EntityListCursorMut<'_, T>
Get a mutable cursor to the item pointed to by ptr.
§Safety
This function may only be called when it is known that ptr refers to an entity which is
linked into this list. This operation will panic if the entity is not linked into any list,
and may result in undefined behavior if the operation is linked into a different list.
Sourcepub fn front_mut(&mut self) -> EntityListCursorMut<'_, T>
pub fn front_mut(&mut self) -> EntityListCursorMut<'_, T>
Get an EntityListCursorMut pointing to the first entity in the list, or the null object if the list is empty
Sourcepub fn back_mut(&mut self) -> EntityListCursorMut<'_, T>
pub fn back_mut(&mut self) -> EntityListCursorMut<'_, T>
Get an EntityListCursorMut pointing to the last entity in the list, or the null object if the list is empty
Sourcepub fn push_front(&mut self, entity: UnsafeIntrusiveEntityRef<T>)
pub fn push_front(&mut self, entity: UnsafeIntrusiveEntityRef<T>)
Prepend entity to this list
Sourcepub fn push_back(&mut self, entity: UnsafeIntrusiveEntityRef<T>)
pub fn push_back(&mut self, entity: UnsafeIntrusiveEntityRef<T>)
Append entity to this list
Sourcepub fn pop_front(&mut self) -> Option<UnsafeIntrusiveEntityRef<T>>
pub fn pop_front(&mut self) -> Option<UnsafeIntrusiveEntityRef<T>>
Remove the entity at the front of the list, returning its UnsafeIntrusiveEntityRef
Returns None if the list is empty.
Sourcepub fn pop_back(&mut self) -> Option<UnsafeIntrusiveEntityRef<T>>
pub fn pop_back(&mut self) -> Option<UnsafeIntrusiveEntityRef<T>>
Remove the entity at the back of the list, returning its UnsafeIntrusiveEntityRef
Returns None if the list is empty.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Removes all items from this list.
This will unlink all entities currently in the list, which requires iterating through all elements in the list. If the entities may be used again, this ensures that their intrusive link is properly unlinked.
Sourcepub fn fast_clear(&mut self)
pub fn fast_clear(&mut self)
Empties the list without properly unlinking the intrusive links of the items in the list.
Since this does not unlink any objects, any attempts to link these objects into another
EntityList will fail but will not cause any memory unsafety. To unlink those objects
manually, you must call the force_unlink function on the link.
Sourcepub fn take(&mut self) -> Self
pub fn take(&mut self) -> Self
Takes all the elements out of the EntityList, leaving it empty.
The taken elements are returned as a new EntityList.
Trait Implementations§
Source§impl<T: Debug> Debug for EntityList<T>
impl<T: Debug> Debug for EntityList<T>
Source§impl<T> Default for EntityList<T>
impl<T> Default for EntityList<T>
impl<T: Eq> Eq for EntityList<T>
Source§impl<T: EntityListItem> FromIterator<RawEntityRef<T, IntrusiveLink>> for EntityList<T>
impl<T: EntityListItem> FromIterator<RawEntityRef<T, IntrusiveLink>> for EntityList<T>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = UnsafeIntrusiveEntityRef<T>>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = UnsafeIntrusiveEntityRef<T>>,
Source§impl<T: Hash> Hash for EntityList<T>
impl<T: Hash> Hash for EntityList<T>
Source§impl<T> IntoIterator for EntityList<T>
impl<T> IntoIterator for EntityList<T>
Source§impl<'a, T> IntoIterator for &'a EntityList<T>
impl<'a, T> IntoIterator for &'a EntityList<T>
Source§impl<T: PartialEq> PartialEq for EntityList<T>
impl<T: PartialEq> PartialEq for EntityList<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for EntityList<T>
impl<T> !Send for EntityList<T>
impl<T> !Sync for EntityList<T>
impl<T> !UnwindSafe for EntityList<T>
impl<T> Freeze for EntityList<T>
impl<T> Unpin for EntityList<T>where
T: Unpin,
impl<T> UnsafeUnpin for EntityList<T>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<From, To, Obj> DowncastFrom<From, Obj> for To
impl<From, To, Obj> DowncastFrom<From, Obj> for To
Source§impl<From, To> DowncastFromRef<From> for To
impl<From, To> DowncastFromRef<From> for To
Source§impl<From, To> DowncastRef<To> for From
impl<From, To> DowncastRef<To> for From
fn downcast_ref(&self) -> Option<&To>
fn downcast_mut(&mut self) -> Option<&mut To>
Source§impl<T> DynPartialEq for T
impl<T> DynPartialEq for T
default fn dyn_eq(&self, rhs: &dyn PartialEqable) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreimpl<Trait, T> Is<Trait> for T
impl<T, Trait> IsObjOf<T> for Trait
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<T> PartialEqable for T
impl<T> PartialEqable for T
Source§impl<T> PassTarget for Twhere
T: 'static,
impl<T> PassTarget for Twhere
T: 'static,
default fn target_name(_context: &Context) -> Option<OperationName>
default fn into_target( op: &RawEntityRef<Operation, IntrusiveLink>, ) -> EntityRef<'_, T>
default fn into_target_mut( op: &mut RawEntityRef<Operation, IntrusiveLink>, ) -> EntityMut<'_, T>
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<From, To, Obj> TryUpcastFrom<From, Obj> for To
impl<From, To, Obj> TryUpcastFrom<From, Obj> for To
Source§impl<From, To> TryUpcastFromRef<From> for To
impl<From, To> TryUpcastFromRef<From> for To
Source§impl<From, To> TryUpcastRef<To> for From
impl<From, To> TryUpcastRef<To> for From
Source§impl<From, To> UpcastFrom<From> for To
impl<From, To> UpcastFrom<From> for To
fn upcast_from_ref(from: &From) -> &To
fn upcast_from_mut(from: &mut From) -> &mut To
fn upcast_from(from: Box<From>) -> Box<To>
Source§impl<T, Trait> Verifier<Trait> for Twhere
Trait: ?Sized,
impl<T, Trait> Verifier<Trait> for Twhere
Trait: ?Sized,
Source§const VACUOUS: bool = const VACUOUS: bool = true;
const VACUOUS: bool = const VACUOUS: bool = true;
Verifier sets this flag to true when its implementation is vacuous,
i.e. it always succeeds and is not dependent on runtime context. Read moreSource§default fn should_verify(&self, _context: &Context) -> bool
default fn should_verify(&self, _context: &Context) -> bool
Source§default fn maybe_verify(&self, _context: &Context) -> Result<(), Report>
default fn maybe_verify(&self, _context: &Context) -> Result<(), Report>
true