pub struct Layer<'map> { /* private fields */ }Expand description
A generic map layer, accessed via Map::layers().
Implementations§
Source§impl<'map> Layer<'map>
impl<'map> Layer<'map>
Sourcepub fn layer_type(&self) -> LayerType<'map>
pub fn layer_type(&self) -> LayerType<'map>
Get the layer’s type.
Sourcepub fn as_tile_layer(self) -> Option<TileLayer<'map>>
pub fn as_tile_layer(self) -> Option<TileLayer<'map>>
Convenience method to return this layer as a tile layer, only if it is one.
Identical to:
ⓘ
match layer.layer_type() {
LayerType::Tiles(x) => Some(x),
_ => None,
}Sourcepub fn as_object_layer(self) -> Option<ObjectLayer<'map>>
pub fn as_object_layer(self) -> Option<ObjectLayer<'map>>
Convenience method to return this layer as an object group, only if it is one.
Identical to:
ⓘ
match layer.layer_type() {
LayerType::Objects(x) => Some(x),
_ => None,
}Sourcepub fn as_image_layer(self) -> Option<ImageLayer<'map>>
pub fn as_image_layer(self) -> Option<ImageLayer<'map>>
Convenience method to return this layer as an image layer, only if it is one.
Identical to:
ⓘ
match layer.layer_type() {
LayerType::Image(x) => Some(x),
_ => None,
}Sourcepub fn as_group_layer(self) -> Option<GroupLayer<'map>>
pub fn as_group_layer(self) -> Option<GroupLayer<'map>>
Convenience method to return this layer as a group layer, only if it is one.
Identical to:
ⓘ
match layer.layer_type() {
LayerType::Group(x) => Some(x),
_ => None,
}Trait Implementations§
impl<'map> Copy for Layer<'map>
Source§impl<'map> PartialEq for Layer<'map>
impl<'map> PartialEq for Layer<'map>
impl<'map> StructuralPartialEq for Layer<'map>
Auto Trait Implementations§
impl<'map> Freeze for Layer<'map>
impl<'map> RefUnwindSafe for Layer<'map>
impl<'map> Send for Layer<'map>
impl<'map> Sync for Layer<'map>
impl<'map> Unpin for Layer<'map>
impl<'map> UnsafeUnpin for Layer<'map>
impl<'map> UnwindSafe for Layer<'map>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> ⓘ
Converts
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> ⓘ
Converts
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 more