Struct mock_builder::location::FunctionLocation
source · pub struct FunctionLocation { /* private fields */ }
Expand description
Absolute string identification of function.
Implementations§
source§impl FunctionLocation
impl FunctionLocation
sourcepub fn from<F: Fn()>(_: F) -> Self
pub fn from<F: Fn()>(_: F) -> Self
Creates a location for the function which created the given closure used as a locator
sourcepub fn normalize(self) -> Self
pub fn normalize(self) -> Self
Normalize the location, allowing to identify the function no matter if it belongs to a trait or not.
sourcepub fn strip_name_prefix(self, prefix: &str) -> Self
pub fn strip_name_prefix(self, prefix: &str) -> Self
Remove the prefix from the function name.
sourcepub fn assimilate_trait_prefix(self) -> Self
pub fn assimilate_trait_prefix(self) -> Self
Remove the trait name from the function name and add such information to
the location. The location is expected to have the following structure:
<path>::<TraitInfo>_<name>
sourcepub fn append_type_signature<I, O>(self) -> Self
pub fn append_type_signature<I, O>(self) -> Self
Add a representation of the function input and output types
Trait Implementations§
source§impl Clone for FunctionLocation
impl Clone for FunctionLocation
source§fn clone(&self) -> FunctionLocation
fn clone(&self) -> FunctionLocation
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 FunctionLocation
impl Debug for FunctionLocation
source§impl PartialEq for FunctionLocation
impl PartialEq for FunctionLocation
source§fn eq(&self, other: &FunctionLocation) -> bool
fn eq(&self, other: &FunctionLocation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for FunctionLocation
impl StructuralPartialEq for FunctionLocation
Auto Trait Implementations§
impl RefUnwindSafe for FunctionLocation
impl Send for FunctionLocation
impl Sync for FunctionLocation
impl Unpin for FunctionLocation
impl UnwindSafe for FunctionLocation
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