Struct vector_lookup::OwnedValuePath
pub struct OwnedValuePath {
pub segments: Vec<OwnedSegment>,
}
Expand description
A lookup path.
Fields§
§segments: Vec<OwnedSegment>
Implementations§
§impl OwnedValuePath
impl OwnedValuePath
pub fn is_root(&self) -> bool
pub fn root() -> OwnedValuePath
pub fn push_field(&mut self, field: &str)
pub fn push_segment(&mut self, segment: OwnedSegment)
pub fn push_front_field(&mut self, field: &str)
pub fn push_front_segment(&mut self, segment: OwnedSegment)
pub fn with_field_appended(&self, field: &str) -> OwnedValuePath
pub fn with_field_prefix(&self, field: &str) -> OwnedValuePath
pub fn with_segment_prefix(&self, segment: OwnedSegment) -> OwnedValuePath
pub fn push_index(&mut self, index: isize)
pub fn with_index_appended(&self, index: isize) -> OwnedValuePath
pub fn single_field(field: &str) -> OwnedValuePath
pub fn to_alternative_components(&self, limit: usize) -> Vec<Vec<&str>>
pub fn to_alternative_components(&self, limit: usize) -> Vec<Vec<&str>>
Create the possible fields that can be followed by this lookup.
The limit specifies the limit of the path depth we are interested in. Metrics is only interested in fields that are up to 3 levels deep (2 levels + 1 to check it terminates).
eg, .tags.nork.noog will never be an accepted path so we don’t need to spend the time collecting it.
pub fn push(&mut self, segment: OwnedSegment)
Trait Implementations§
§impl Clone for OwnedValuePath
impl Clone for OwnedValuePath
§fn clone(&self) -> OwnedValuePath
fn clone(&self) -> OwnedValuePath
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 more§impl Debug for OwnedValuePath
impl Debug for OwnedValuePath
§impl<'de> Deserialize<'de> for OwnedValuePath
impl<'de> Deserialize<'de> for OwnedValuePath
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OwnedValuePath, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OwnedValuePath, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for OwnedValuePath
impl Display for OwnedValuePath
source§impl From<OwnedValuePath> for OptionalValuePath
impl From<OwnedValuePath> for OptionalValuePath
source§fn from(path: OwnedValuePath) -> Self
fn from(path: OwnedValuePath) -> Self
Converts to this type from the input type.
§impl From<Vec<OwnedSegment>> for OwnedValuePath
impl From<Vec<OwnedSegment>> for OwnedValuePath
§fn from(segments: Vec<OwnedSegment>) -> OwnedValuePath
fn from(segments: Vec<OwnedSegment>) -> OwnedValuePath
Converts to this type from the input type.
§impl FromStr for OwnedValuePath
impl FromStr for OwnedValuePath
§type Err = PathParseError
type Err = PathParseError
The associated error which can be returned from parsing.
§fn from_str(
src: &str,
) -> Result<OwnedValuePath, <OwnedValuePath as FromStr>::Err>
fn from_str( src: &str, ) -> Result<OwnedValuePath, <OwnedValuePath as FromStr>::Err>
Parses a string
s
to return a value of this type. Read more§impl Hash for OwnedValuePath
impl Hash for OwnedValuePath
§impl Ord for OwnedValuePath
impl Ord for OwnedValuePath
§impl PartialEq for OwnedValuePath
impl PartialEq for OwnedValuePath
§fn eq(&self, other: &OwnedValuePath) -> bool
fn eq(&self, other: &OwnedValuePath) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for OwnedValuePath
impl PartialOrd for OwnedValuePath
§fn partial_cmp(&self, other: &OwnedValuePath) -> Option<Ordering>
fn partial_cmp(&self, other: &OwnedValuePath) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl Serialize for OwnedValuePath
impl Serialize for OwnedValuePath
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFrom<KeyString> for OwnedValuePath
impl TryFrom<KeyString> for OwnedValuePath
§type Error = PathParseError
type Error = PathParseError
The type returned in the event of a conversion error.
§fn try_from(
src: KeyString,
) -> Result<OwnedValuePath, <OwnedValuePath as TryFrom<KeyString>>::Error>
fn try_from( src: KeyString, ) -> Result<OwnedValuePath, <OwnedValuePath as TryFrom<KeyString>>::Error>
Performs the conversion.
§impl TryFrom<String> for OwnedValuePath
impl TryFrom<String> for OwnedValuePath
§type Error = PathParseError
type Error = PathParseError
The type returned in the event of a conversion error.
§fn try_from(
src: String,
) -> Result<OwnedValuePath, <OwnedValuePath as TryFrom<String>>::Error>
fn try_from( src: String, ) -> Result<OwnedValuePath, <OwnedValuePath as TryFrom<String>>::Error>
Performs the conversion.
§impl<'a> ValuePath<'a> for &'a OwnedValuePath
impl<'a> ValuePath<'a> for &'a OwnedValuePath
type Iter = OwnedSegmentSliceIter<'a>
§fn segment_iter(&self) -> <&'a OwnedValuePath as ValuePath<'a>>::Iter
fn segment_iter(&self) -> <&'a OwnedValuePath as ValuePath<'a>>::Iter
Iterates over the raw “Borrowed” segments.
fn concat<T>(&self, path: T) -> PathConcat<Self, T>where
T: ValuePath<'a>,
fn eq(&self, other: impl ValuePath<'a>) -> bool
fn can_start_with(&self, prefix: impl ValuePath<'a>) -> bool
fn to_owned_value_path(&self) -> Result<OwnedValuePath, ()>
impl Eq for OwnedValuePath
impl StructuralPartialEq for OwnedValuePath
Auto Trait Implementations§
impl Freeze for OwnedValuePath
impl RefUnwindSafe for OwnedValuePath
impl Send for OwnedValuePath
impl Sync for OwnedValuePath
impl Unpin for OwnedValuePath
impl UnwindSafe for OwnedValuePath
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
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
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<I> IntoResettable<String> for I
impl<I> IntoResettable<String> for I
§fn into_resettable(self) -> Resettable<String>
fn into_resettable(self) -> Resettable<String>
Convert to the intended resettable type
§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
Performs an infallible conversion.
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Set the foreground color generically Read more
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Set the background color generically. Read more
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
Change the background color to yellow
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Change the foreground color to magenta
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Change the background color to magenta
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Change the background color to purple
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
Change the foreground color to the terminal default
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
Change the background color to the terminal default
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
Change the foreground color to bright black
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
Change the background color to bright black
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
Change the foreground color to bright red
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
Change the background color to bright red
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
Change the foreground color to bright green
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
Change the background color to bright green
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
Change the foreground color to bright yellow
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
Change the background color to bright yellow
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
Change the foreground color to bright blue
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
Change the background color to bright blue
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Change the foreground color to bright magenta
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Change the background color to bright magenta
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Change the foreground color to bright purple
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Change the background color to bright purple
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
Change the foreground color to bright cyan
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
Change the background color to bright cyan
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
Change the foreground color to bright white
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
Change the background color to bright white
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
Make the text blink (but fast!)
Hide the text
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
Cross out the text
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the foreground color at runtime. Only use if you do not know which color will be used at
compile-time. If the color is constant, use either
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the background color at runtime. Only use if you do not know what color to use at
compile-time. If the color is constant, use either
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the foreground color to a specific RGB value.
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the background color to a specific RGB value.
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Sets the foreground color to an RGB value.
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Sets the background color to an RGB value.