pub struct MockPathResolver { /* private fields */ }
Implementations§
source§impl MockPathResolver
impl MockPathResolver
sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new
method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new
method can still be called
like <MockX as TraitY>::new
source§impl MockPathResolver
impl MockPathResolver
sourcepub fn expect_resolve(&mut self) -> &mut Expectation
pub fn expect_resolve(&mut self) -> &mut Expectation
Create an Expectation
for mocking the resolve
method
sourcepub fn expect_get_mount_path(&mut self) -> &mut Expectation
pub fn expect_get_mount_path(&mut self) -> &mut Expectation
Create an Expectation
for mocking the get_mount_path
method
Trait Implementations§
source§impl Debug for MockPathResolver
impl Debug for MockPathResolver
source§impl Default for MockPathResolver
impl Default for MockPathResolver
source§impl PathResolver for MockPathResolver
impl PathResolver for MockPathResolver
source§fn resolve(
&self,
path: &Path
) -> Result<HashSet<ResolvedPath>, PathResolutionError>
fn resolve( &self, path: &Path ) -> Result<HashSet<ResolvedPath>, PathResolutionError>
Returns Storages of containers claiming paths that match the provided argument along with the part of a path that is inside the container.
Example: if a container claims path /a/b/
and PathResolver
receives request to resolve
path /a/b/c/d
then PathResolver
should return path /c/d
with Storage of that
container.
Storages from different containers are represented by different elements in a resulting sequence because the matching paths inside containers may be different. Additionally, method returns full paths of containers that starts with the provided one as an argument.
E.g. if container C1 claims path /a/
and container C2 claims path /a/b/
and container C3 claims
path /a/b/c/d
when PathResolver is asked about path /a/b/c
, then three-element vector is returned:
[ PathWithStorages { path: "/b/c/", storage: storage of C1}, PathWithStorages { path: "/c/", storage: storage of C2}, VirtualPath ( "/a/b/c/d" ), ]
source§fn get_mount_path(
&self,
identifier: Uuid
) -> Result<Option<PathBuf>, PathResolutionError>
fn get_mount_path( &self, identifier: Uuid ) -> Result<Option<PathBuf>, PathResolutionError>
Returns optional path of a container with given uuid.