scopegraphs/storage.rs
1use bumpalo::Bump;
2
3/// Holds data for a [`ScopeGraph`](crate::ScopeGraph). Required to construct a `ScopeGraph`.
4///
5/// A `ScopeGraph` will use the storage object to allocate in,
6/// and lifetimes of items in the scope graph will be tied to an instance of `Storage`.
7#[derive(Default)]
8pub struct Storage(pub Bump);
9
10impl Storage {
11 /// Creates a new storage object.
12 pub fn new() -> Self {
13 Self(Bump::new())
14 }
15}