pub struct Id { /* private fields */ }
Expand description
A extension Id. The Self::priority
is used for sorting extensions
and Self::name
for debugging which extensions are mounted.
Higher priority
extensions are ran first.
The debug name is useful when you want to see which priorities
other extensions use. This is beneficial when creating “plug-and-play” extensions.
If two extensions with identical priority
s are inserted, the latter will override the
prior. This only effects extensions of the same type.
Implementations§
source§impl Id
impl Id
sourcepub fn new(priority: i32, name: &'static str) -> Self
pub fn new(priority: i32, name: &'static str) -> Self
Creates a new Id with priority
and a name
.
sourcepub fn without_name(priority: i32) -> Self
pub fn without_name(priority: i32) -> Self
Creates a Id without a name. This is considered a bad practice,
as you cannot see which extensions are mounted to the
Extensions
.
See Self::name
for details about how this affects output.
sourcepub fn no_override(self) -> Self
pub fn no_override(self) -> Self
Always inserts this extension.
If an extension with the same priority
exist, the priority
is decremented and tried again.
sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Returns the name of this Id.
If the Id is created with Self::without_name
,
this returns Unnamed
.
Trait Implementations§
source§impl Ord for Id
impl Ord for Id
source§impl PartialOrd for Id
impl PartialOrd for Id
impl Copy for Id
impl Eq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
Blanket Implementations§
source§impl<T> AsCleanDebug for Twhere
T: Display,
impl<T> AsCleanDebug for Twhere
T: Display,
source§fn as_clean(&self) -> CleanDebug<'_, Self>where
Self: Display,
fn as_clean(&self) -> CleanDebug<'_, Self>where
Self: Display,
CleanDebug
for Self. Read moresource§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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()
Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString
. Read more