pub struct MemoryResolver { /* private fields */ }Expand description
Serves layers held in memory, keyed by the exact import uri, like
upstream’s InMemoryLayerProvider.
Implementations§
Source§impl MemoryResolver
impl MemoryResolver
pub fn new() -> Self
Sourcepub fn insert(
&mut self,
uri: impl Into<String>,
bytes: impl Into<Vec<u8>>,
) -> Option<Vec<u8>>
pub fn insert( &mut self, uri: impl Into<String>, bytes: impl Into<Vec<u8>>, ) -> Option<Vec<u8>>
Serves bytes for uri, replacing and returning any earlier entry.
Sourcepub fn insert_file(
&mut self,
file: &IfcxFile,
) -> Result<Option<Vec<u8>>, WriteError>
pub fn insert_file( &mut self, file: &IfcxFile, ) -> Result<Option<Vec<u8>>, WriteError>
Serves file under its header.id, as upstream’s in-memory provider
does. An integrity check on such a layer hashes the JSON this crate
writes, not any original bytes.
Trait Implementations§
Source§impl Clone for MemoryResolver
impl Clone for MemoryResolver
Source§fn clone(&self) -> MemoryResolver
fn clone(&self) -> MemoryResolver
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryResolver
impl Debug for MemoryResolver
Source§impl Default for MemoryResolver
impl Default for MemoryResolver
Source§fn default() -> MemoryResolver
fn default() -> MemoryResolver
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryResolver
impl RefUnwindSafe for MemoryResolver
impl Send for MemoryResolver
impl Sync for MemoryResolver
impl Unpin for MemoryResolver
impl UnwindSafe for MemoryResolver
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