pub struct Candidate {
pub stem: RawStr,
pub suffix: &'static [u8],
}Expand description
One candidate name: a slice of the resource path followed by a suffix,
built in a charged vector when a lookup needs it whole (Self::joined_vec).
Fields§
§stem: RawStrA slice of the resource path (no copy): its basename for the first
candidate, that basename’s splitext root for the others.
suffix: &'static [u8]One of SUFFIXES.
Implementations§
Source§impl Candidate
impl Candidate
Sourcepub fn joined_vec(
&self,
meter: &Arc<Meter>,
) -> Result<MeteredVec<u8>, ChargeError>
pub fn joined_vec( &self, meter: &Arc<Meter>, ) -> Result<MeteredVec<u8>, ChargeError>
The whole lookup name in charged, fallibly allocated storage, without
a shared Bytes owner. Borrow it for registry and resolver lookups.
Sourcepub fn joined(&self, meter: &Arc<Meter>) -> Result<RawStr, ChargeError>
pub fn joined(&self, meter: &Arc<Meter>) -> Result<RawStr, ChargeError>
The whole name: the stem itself when there is no suffix (no copy),
else the stem and the suffix in one buffer charged to meter first
(RawStr::charged_concat), which the name carries until its last
clone drops. A refusal allocates nothing.
Trait Implementations§
impl Eq for Candidate
impl StructuralPartialEq for Candidate
Auto Trait Implementations§
impl !Freeze for Candidate
impl !RefUnwindSafe for Candidate
impl !UnwindSafe for Candidate
impl Forget for Candidate
impl Move for Candidate
impl Send for Candidate
impl Sync for Candidate
impl Unpin for Candidate
impl UnsafeUnpin for Candidate
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