Struct vector_lookup::path::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
§impl PartialOrd for OwnedValuePath
impl PartialOrd for OwnedValuePath
§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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Change the background color to magenta
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Change the foreground color to the terminal default
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Change the background color to the terminal default
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Change the foreground color to bright black
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Change the background color to bright black
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Change the foreground color to bright red
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Change the background color to bright red
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Change the foreground color to bright green
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Change the background color to bright green
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Change the foreground color to bright yellow
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Change the background color to bright yellow
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Change the foreground color to bright blue
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Change the background color to bright blue
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright magenta
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright magenta
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright purple
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright purple
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Change the foreground color to bright cyan
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Change the background color to bright cyan
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Change the foreground color to bright white
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Change the background color to bright white
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Make the text blink (but fast!)
Hide the text
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, 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.
§fn if_supports_color<'a, Out, ApplyFn>(
&'a self,
stream: impl Into<Stream>,
apply: ApplyFn,
) -> SupportsColorsDisplay<'a, Self, Out, ApplyFn>where
ApplyFn: Fn(&'a Self) -> Out,
fn if_supports_color<'a, Out, ApplyFn>(
&'a self,
stream: impl Into<Stream>,
apply: ApplyFn,
) -> SupportsColorsDisplay<'a, Self, Out, ApplyFn>where
ApplyFn: Fn(&'a Self) -> Out,
Apply a given transformation function to all formatters if the given stream
supports at least basic ANSI colors, allowing you to conditionally apply
given styles/colors. Read more