pub struct MemSource {
pub caps: SourceCapabilities,
pub files: BTreeMap<String, String>,
pub log: Vec<(&'static str, String, String)>,
/* private fields */
}Expand description
An in-memory source for tests: a path → content map with a configurable
capability set; writes and removes are applied to the map and logged.
Fields§
§caps: SourceCapabilities§files: BTreeMap<String, String>§log: Vec<(&'static str, String, String)>("write", path, content) / ("remove", path, "") in call order.
Implementations§
Trait Implementations§
Source§impl SyncSource for MemSource
impl SyncSource for MemSource
fn capabilities(&self) -> SourceCapabilities
Source§fn fetch(&mut self, path: &str) -> Result<Option<SourceItem>>
fn fetch(&mut self, path: &str) -> Result<Option<SourceItem>>
One member’s current state, or
None when it left the scope.Source§fn write(&mut self, path: &str, content: &str) -> Result<()>
fn write(&mut self, path: &str, content: &str) -> Result<()>
Persist engine-authored bytes (write-through sources only).
Auto Trait Implementations§
impl Freeze for MemSource
impl RefUnwindSafe for MemSource
impl Send for MemSource
impl Sync for MemSource
impl Unpin for MemSource
impl UnsafeUnpin for MemSource
impl UnwindSafe for MemSource
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