MCPcopy Create free account
hub / github.com/fadeevab/design-patterns-rust / new

Method new

structural/composite/fs/folder.rs:9–14  ·  view source on GitHub ↗
(name: &'static str)

Source from the content-addressed store, hash-verified

7
8impl Folder {
9 pub fn new(name: &'static str) -> Self {
10 Self {
11 name,
12 components: vec![],
13 }
14 }
15
16 pub fn add(&mut self, component: impl Component + 'static) {
17 self.components.push(Box::new(component));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected