pub enum LayerType {
TileLayer(TileLayer),
ObjectGroup(ObjectGroup),
ImageLayer(ImageLayer),
Group {
layers: Vec<Layer>,
},
}
Expand description
Contains the data for this variant of layer
§Example
match &layer_type {
LayerType::TileLayer(tiles) => {
//do_something(tiles);
}
LayerType::Group { layers } => {
&mut render_layers(layers);
}
LayerType::ImageLayer(image) => {
//do_something_else(image);
}
LayerType::ObjectGroup(objects) => {
//and_another_thing(objects);
}
}
Variants§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LayerType
impl<'de> Deserialize<'de> for LayerType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for LayerType
Auto Trait Implementations§
impl Freeze for LayerType
impl RefUnwindSafe for LayerType
impl Send for LayerType
impl Sync for LayerType
impl Unpin for LayerType
impl UnwindSafe for LayerType
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