pub fn folder(&self, id: LayerId) -> Option<&FolderLayer> {
		match self.layer(id) {
			Some(Layer {
				data: LayerDataType::Folder(folder), ..
			}) => Some(folder),
			_ => None,
		}
	}
/// Tries to get a reference to a folder with the given [LayerId].
/// This operation will return `None` if either no layer with `id` exists
/// in the folder, or the layer with matching ID is not a folder.
///
/// # Example
/// ```
/// # use graphite_graphene::layers::folder_layer::FolderLayer;
/// # use graphite_graphene::layers::shape_layer::ShapeLayer;
/// # use graphite_graphene::layers::style::PathStyle;
/// let mut folder = FolderLayer::default();
///
/// // Search for an id that does not exist
/// assert!(folder.folder(132).is_none());
///
/// // add a folder and search for it
/// folder.add_layer(FolderLayer::default().into(), Some(123), -1);
/// assert!(folder.folder(123).is_some());
///
/// // add a non-folder layer and search for it
/// folder.add_layer(ShapeLayer::rectangle(PathStyle::default()).into(), Some(42), -1);
/// assert!(folder.folder(42).is_none());
/// ```
Tries to get a reference to a folder with the given [LayerId].
This operation will return `None` if either no layer with `id` exists
in the folder, or the layer with matching ID is not a folder.
Tries to get a reference to a folder with the given [ LayerId ] . This operation will return ` None ` if either no layer with ` id ` exists in the folder or the layer with matching ID is not a folder .
pub fn folder(&self, id: LayerId) -> Option<&FolderLayer> {
		match self.layer(id) {
			Some(Layer {
				data: LayerDataType::Folder(folder), ..
			}) => Some(folder),
			_ => None,
		}
	}
pub fn folder ( & self , id : LayerId ) -> Option < & FolderLayer > { match self . layer ( id ) { Some ( Layer { data : LayerDataType :: Folder ( folder ) , .. } ) => Some ( folder ) , _ => None , } }
Tries to get a reference to a folder with the given [LayerId].
Tries to get a reference to a folder with the given [ LayerId ] .
&self
id
LayerId
&self
id
LayerId
example
None
use graphite_graphene::layers::folder_layer::folderlayer;
None
use graphite_graphene::layers::shape_layer::shapelayer;
None
use graphite_graphene::layers::style::pathstyle;
let mut folder = FolderLayer::default().

Search for an id that does not exist
assert!(folder.folder(132).is_none()).

add a folder and search for it
folder.add_layer(FolderLayer::default().into(), Some(123), -1);
assert!(folder.folder(123).is_some()).

add a non-folder layer and search for it
folder.add_layer(ShapeLayer::rectangle(PathStyle::default()).into(), Some(42), -1);
assert!(folder.folder(42).is_none());
```
let mut folder = FolderLayer :: default () . Search for an id that does not exist assert! ( folder . folder ( 132 ) . is_none () ) . add a folder and search for it folder . add_layer ( FolderLayer :: default () . into () Some ( 123 ) - 1 ) ; assert! ( folder . folder ( 123 ) . is_some () ) . add a non - folder layer and search for it folder . add_layer ( ShapeLayer :: rectangle ( PathStyle :: default () ) . into () Some ( 42 ) - 1 ) ; assert! ( folder . folder ( 42 ) . is_none () ) ; ` ` `