Enum bevy::prelude::SceneFilter
pub enum SceneFilter {
Unset,
Allowlist(HashSet<TypeId, BuildHasherDefault<AHasher>, Global>),
Denylist(HashSet<TypeId, BuildHasherDefault<AHasher>, Global>),
}
Expand description
A filter used to control which types can be added to a DynamicScene
.
This scene filter can be used more generically to represent a filter for any given type;
however, note that its intended usage with DynamicScene
only considers components and resources.
Adding types that are not a component or resource will have no effect when used with DynamicScene
.
Variants§
Unset
Represents an unset filter.
This is the equivalent of an empty Denylist
or an Allowlist
containing every type—
essentially, all types are permissible.
Allowing a type will convert this filter to an Allowlist
.
Similarly, denying a type will convert this filter to a Denylist
.
Allowlist(HashSet<TypeId, BuildHasherDefault<AHasher>, Global>)
Contains the set of permitted types by their TypeId
.
Types not contained within this set should not be allowed to be saved to an associated DynamicScene
.
Denylist(HashSet<TypeId, BuildHasherDefault<AHasher>, Global>)
Contains the set of prohibited types by their TypeId
.
Types contained within this set should not be allowed to be saved to an associated DynamicScene
.
Implementations§
§impl SceneFilter
impl SceneFilter
pub fn allow_all() -> SceneFilter
pub fn allow_all() -> SceneFilter
Creates a filter where all types are allowed.
This is the equivalent of creating an empty Denylist
.
pub fn deny_all() -> SceneFilter
pub fn deny_all() -> SceneFilter
Creates a filter where all types are denied.
This is the equivalent of creating an empty Allowlist
.
pub fn allow<T>(self) -> SceneFilterwhere
T: Any,
pub fn allow<T>(self) -> SceneFilterwhere T: Any,
pub fn allow_by_id(self, type_id: TypeId) -> SceneFilter
pub fn allow_by_id(self, type_id: TypeId) -> SceneFilter
pub fn deny<T>(self) -> SceneFilterwhere
T: Any,
pub fn deny<T>(self) -> SceneFilterwhere T: Any,
pub fn deny_by_id(self, type_id: TypeId) -> SceneFilter
pub fn deny_by_id(self, type_id: TypeId) -> SceneFilter
pub fn is_allowed<T>(&self) -> boolwhere
T: Any,
pub fn is_allowed<T>(&self) -> boolwhere T: Any,
Returns true if the given type, T
, is allowed by the filter.
If the filter is Unset
, this will always return true
.
pub fn is_allowed_by_id(&self, type_id: TypeId) -> bool
pub fn is_allowed_by_id(&self, type_id: TypeId) -> bool
Returns true if the given type is allowed by the filter.
If the filter is Unset
, this will always return true
.
pub fn is_denied<T>(&self) -> boolwhere
T: Any,
pub fn is_denied<T>(&self) -> boolwhere T: Any,
Returns true if the given type, T
, is denied by the filter.
If the filter is Unset
, this will always return false
.
pub fn is_denied_by_id(&self, type_id: TypeId) -> bool
pub fn is_denied_by_id(&self, type_id: TypeId) -> bool
Returns true if the given type is denied by the filter.
If the filter is Unset
, this will always return false
.
pub fn iter(&self) -> Box<dyn ExactSizeIterator<Item = &TypeId> + '_, Global>
pub fn iter(&self) -> Box<dyn ExactSizeIterator<Item = &TypeId> + '_, Global>
Returns an iterator over the items in the filter.
If the filter is Unset
, this will return an empty iterator.
Trait Implementations§
§impl Clone for SceneFilter
impl Clone for SceneFilter
§fn clone(&self) -> SceneFilter
fn clone(&self) -> SceneFilter
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for SceneFilter
impl Debug for SceneFilter
§impl Default for SceneFilter
impl Default for SceneFilter
§fn default() -> SceneFilter
fn default() -> SceneFilter
§impl IntoIterator for SceneFilter
impl IntoIterator for SceneFilter
§impl PartialEq<SceneFilter> for SceneFilter
impl PartialEq<SceneFilter> for SceneFilter
§fn eq(&self, other: &SceneFilter) -> bool
fn eq(&self, other: &SceneFilter) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for SceneFilter
impl StructuralEq for SceneFilter
impl StructuralPartialEq for SceneFilter
Auto Trait Implementations§
impl RefUnwindSafe for SceneFilter
impl Send for SceneFilter
impl Sync for SceneFilter
impl Unpin for SceneFilter
impl UnwindSafe for SceneFilter
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
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.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.