pub struct MockPathResolver { /* private fields */ }

Implementations§

source§

impl MockPathResolver

source

pub fn checkpoint(&mut self)

Validate that all current expectations for all methods have been satisfied, and discard them.

source

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

source

pub fn expect_resolve(&mut self) -> &mut Expectation

Create an Expectation for mocking the resolve method

source

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for MockPathResolver

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PathResolver for MockPathResolver

source§

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>

Returns optional path of a container with given uuid.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more