Struct kas::view::filter::UnsafeFilteredList
source · pub struct UnsafeFilteredList<A>where
A: ListData + 'static,{ /* private fields */ }
view
only.Expand description
Filtered view over a list
WARNING: this struct is unsafe
because it contains lifetime-bound
references cast to 'static
. Instances or copies of this struct must
not outlive functions they are passed into.
(This is a poor design since it does not properly capsulate unsafety,
used for compatibility with other components. It does at least
encapsulate unsafety since this struct is only accessible behind a
non-mut
reference, cannot be copied, and none of its methods return
references which don’t have their own lifetime bound. Eventually the
plan is to make Widget::Data
a GAT (once Rust supports object-safe
GAT traits), after which this struct may have a lifetime bound.)
This is an abstraction over a ListData
. Items and associated keys
are not adjusted in any way.
The filter applies to SharedData::contains_key
and ListData
methods, but not to SharedData::borrow
(the latter can thus access
items excluded by the filter).
Trait Implementations§
source§impl<A> Debug for UnsafeFilteredList<A>
impl<A> Debug for UnsafeFilteredList<A>
source§impl<A> ListData for UnsafeFilteredList<A>where
A: ListData + 'static,
impl<A> ListData for UnsafeFilteredList<A>where
A: ListData + 'static,
type KeyIter<'b> = KeyIter<'b, <A as SharedData>::Key> where UnsafeFilteredList<A>: 'b
§type Key = <A as SharedData>::Key
type Key = <A as SharedData>::Key
§type Item = <A as SharedData>::Item
type Item = <A as SharedData>::Item
§type ItemRef<'b> = <A as SharedData>::ItemRef<'b>
where
A: 'b
type ItemRef<'b> = <A as SharedData>::ItemRef<'b> where A: 'b
source§fn contains_key(&self, key: &<UnsafeFilteredList<A> as SharedData>::Key) -> bool
fn contains_key(&self, key: &<UnsafeFilteredList<A> as SharedData>::Key) -> bool
source§fn borrow(
&self,
key: &<UnsafeFilteredList<A> as SharedData>::Key
) -> Option<<UnsafeFilteredList<A> as SharedData>::ItemRef<'_>>
fn borrow( &self, key: &<UnsafeFilteredList<A> as SharedData>::Key ) -> Option<<UnsafeFilteredList<A> as SharedData>::ItemRef<'_>>
key
Read moreAuto Trait Implementations§
impl<A> RefUnwindSafe for UnsafeFilteredList<A>
impl<A> Send for UnsafeFilteredList<A>
impl<A> Sync for UnsafeFilteredList<A>
impl<A> Unpin for UnsafeFilteredList<A>
impl<A> UnwindSafe for UnsafeFilteredList<A>
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<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
§fn cast_approx(self) -> T
fn cast_approx(self) -> T
§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
§fn cast_floor(self) -> T
fn cast_floor(self) -> T
§fn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
§fn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
§fn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
§fn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.