Struct mockable::MockMetadata

source ·
pub struct MockMetadata { /* private fields */ }
Expand description

mockall implementation of Metadata.

This is supported on feature=mock only.

Implementations§

source§

impl MockMetadata

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 MockMetadata

source

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

Create an Expectation for mocking the accessed method

source

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

Create an Expectation for mocking the created method

source

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

Create an Expectation for mocking the into_metadata method

source

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

Create an Expectation for mocking the is_dir method

source

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

Create an Expectation for mocking the is_file method

Create an Expectation for mocking the is_symlink method

source

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

Create an Expectation for mocking the len method

source

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

Create an Expectation for mocking the modified method

source

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

Create an Expectation for mocking the permissions method

source

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

Create an Expectation for mocking the to_metadata method

Trait Implementations§

source§

impl Default for MockMetadata

source§

fn default() -> Self

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

impl Metadata for MockMetadata

source§

fn accessed(&self) -> Result<SystemTime>

See std::fs::Metadata::accessed for more details.
source§

fn created(&self) -> Result<SystemTime>

See std::fs::Metadata::created for more details.
source§

fn into_metadata(self: Box<MockMetadata>) -> Metadata

Converts this trait object into a std::fs::Metadata instance.
source§

fn is_dir(&self) -> bool

See std::fs::Metadata::is_dir for more details.
source§

fn is_file(&self) -> bool

See std::fs::Metadata::is_file for more details.
See std::fs::Metadata::is_symlink for more details.
source§

fn len(&self) -> u64

See std::fs::Metadata::len for more details.
source§

fn modified(&self) -> Result<SystemTime>

See std::fs::Metadata::modified for more details.
source§

fn permissions(&self) -> Box<dyn Permissions>

See std::fs::Metadata::permissions for more details.
source§

fn to_metadata(&self) -> &Metadata

Returns a reference to the underlying std::fs::Metadata instance.

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, Global>) -> Rc<dyn Any, Global>

§

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

§

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

§

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

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