Insert a new resource into the store. If a resource with this `TypeID` already exists, then an error will be returned instead.
(&mut self, resource: S)
| 1038 | } |
| 1039 | |
| 1040 | /// A type-erased store accessible to all [`AudioNodeProcessor`]s. |
| 1041 | pub struct ProcStore(HashMap<TypeId, Box<dyn Any + Send>>); |
| 1042 | |
| 1043 | impl ProcStore { |
| 1044 | pub fn with_capacity(capacity: usize) -> Self { |
| 1045 | let mut h = HashMap::default(); |
| 1046 | h.reserve(capacity); |
| 1047 | Self(h) |
| 1048 | } |
| 1049 | |
| 1050 | /// Insert a new resource into the store. |
no test coverage detected