#[non_exhaustive]pub struct PayloadMagicCandidate<'a> {
pub id: &'a CodecId,
pub magic: &'a [u8],
pub priority: i32,
pub order: usize,
}Expand description
One ranked entry from CodecRegistry::resolve_payload_magic_candidates.
Ordered by the registry’s resolution rule — magic length
descending (most specific prefix), then priority ascending, then
order ascending — so the first element is exactly what
CodecRegistry::resolve_payload_magic_ref returns.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: &'a CodecIdCodec id of the claiming registration.
magic: &'a [u8]The magic prefix that matched.
priority: i32Claim tie-break priority (see CodecInfo::resolution_priority).
order: usize0-based registration sequence number — the final tie-break.
Trait Implementations§
Source§impl<'a> Clone for PayloadMagicCandidate<'a>
impl<'a> Clone for PayloadMagicCandidate<'a>
impl<'a> Copy for PayloadMagicCandidate<'a>
Source§impl<'a> Debug for PayloadMagicCandidate<'a>
impl<'a> Debug for PayloadMagicCandidate<'a>
impl<'a> Eq for PayloadMagicCandidate<'a>
Source§impl<'a> PartialEq for PayloadMagicCandidate<'a>
impl<'a> PartialEq for PayloadMagicCandidate<'a>
impl<'a> StructuralPartialEq for PayloadMagicCandidate<'a>
Auto Trait Implementations§
impl<'a> Freeze for PayloadMagicCandidate<'a>
impl<'a> RefUnwindSafe for PayloadMagicCandidate<'a>
impl<'a> Send for PayloadMagicCandidate<'a>
impl<'a> Sync for PayloadMagicCandidate<'a>
impl<'a> Unpin for PayloadMagicCandidate<'a>
impl<'a> UnsafeUnpin for PayloadMagicCandidate<'a>
impl<'a> UnwindSafe for PayloadMagicCandidate<'a>
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