pub struct ValueCodecRegistrationSource { /* private fields */ }Expand description
Source location for one linked value-codec registration.
The four parts are captured at compile time by the registration macros from
CARGO_PKG_NAME, module_path!, file!, and line!, so they point at the
declaration site rather than at the call site that later looks the
registration up. Ordering compares the source fields in derived order:
crate name, module path, file, then line. Duplicate reports therefore have
stable source-field ordering independent of registration iteration order.
§Examples
use qubit_codec::ValueCodecRegistrationSource;
let source = ValueCodecRegistrationSource::new(
"qubit-codec",
"my_crate::codecs",
"src/codec.rs",
42,
);
assert_eq!(source.crate_name(), "qubit-codec");
assert_eq!(source.line(), 42);Implementations§
Source§impl ValueCodecRegistrationSource
impl ValueCodecRegistrationSource
Sourcepub const fn crate_name(&self) -> &'static str
pub const fn crate_name(&self) -> &'static str
Returns the declaring crate name.
§Returns
Returns the CARGO_PKG_NAME of the crate that declared the codec.
Sourcepub const fn module_path(&self) -> &'static str
pub const fn module_path(&self) -> &'static str
Trait Implementations§
Source§impl Clone for ValueCodecRegistrationSource
impl Clone for ValueCodecRegistrationSource
impl Copy for ValueCodecRegistrationSource
Source§impl Debug for ValueCodecRegistrationSource
impl Debug for ValueCodecRegistrationSource
impl Eq for ValueCodecRegistrationSource
Source§impl Ord for ValueCodecRegistrationSource
impl Ord for ValueCodecRegistrationSource
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for ValueCodecRegistrationSource
impl PartialOrd for ValueCodecRegistrationSource
impl StructuralPartialEq for ValueCodecRegistrationSource
Auto Trait Implementations§
impl Forget for ValueCodecRegistrationSource
impl Freeze for ValueCodecRegistrationSource
impl RefUnwindSafe for ValueCodecRegistrationSource
impl Send for ValueCodecRegistrationSource
impl Sync for ValueCodecRegistrationSource
impl Unpin for ValueCodecRegistrationSource
impl UnsafeUnpin for ValueCodecRegistrationSource
impl UnwindSafe for ValueCodecRegistrationSource
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