Struct re_log_types::path::EntityPathPart
source · pub struct EntityPathPart(InternedString);
Expand description
The different parts that make up an EntityPath
.
A non-empty string.
Note that the contents of the string is NOT escaped,
so escaping needs to be done when printing this
using Self::escaped_string
.
Because of this, EntityPathPart
does NOT implement AsRef<str>
etc,
nor does it implement Display
: you must explicitly chose
either the escaped or the unescaped version of it.
In the file system analogy, this is the name of a folder.
Tuple Fields§
§0: InternedString
We use an interned string for fast copies, fast hashing, and to save memory.
Note that re_string_interner
never frees memory, but even if a user
allocates 100k different entity parts (which is crazy many lot), the memory usage
will still only be in the low megabytes.
Implementations§
source§impl EntityPathPart
impl EntityPathPart
sourcepub fn new(unescaped_string: impl Into<InternedString>) -> Self
pub fn new(unescaped_string: impl Into<InternedString>) -> Self
The given string is expected to be unescaped, i.e. any \
is treated as a normal character.
sourcepub fn parse_forgiving(input: &str) -> Self
pub fn parse_forgiving(input: &str) -> Self
Unescape the string, forgiving any syntax error with a best-effort approach.
sourcepub fn parse_forgiving_with_warning(
input: &str,
warnings: Option<&mut Vec<String>>
) -> Self
pub fn parse_forgiving_with_warning( input: &str, warnings: Option<&mut Vec<String>> ) -> Self
Unescape the string, forgiving any syntax error with a best-effort approach.
Returns a warnings for potentially serious problems:
- any unknown escape sequences
- unescaped spaces
sourcepub fn parse_strict(input: &str) -> Result<Self, PathParseError>
pub fn parse_strict(input: &str) -> Result<Self, PathParseError>
Unescape the string, returning errors on wrongly escaped input.
sourcepub fn unescaped_str(&self) -> &str
pub fn unescaped_str(&self) -> &str
The unescaped string.
Use Self::escaped_string
to escape it.
Use this when it is standalone in a ui somewhere.
sourcepub fn escaped_string(&self) -> String
pub fn escaped_string(&self) -> String
Use this when it is part of a full entity path.
Trait Implementations§
source§impl Clone for EntityPathPart
impl Clone for EntityPathPart
source§fn clone(&self) -> EntityPathPart
fn clone(&self) -> EntityPathPart
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EntityPathPart
impl Debug for EntityPathPart
source§impl<'de> Deserialize<'de> for EntityPathPart
impl<'de> Deserialize<'de> for EntityPathPart
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<&str> for EntityPathPart
impl From<&str> for EntityPathPart
source§impl From<InternedString> for EntityPathPart
impl From<InternedString> for EntityPathPart
source§fn from(part: InternedString) -> Self
fn from(part: InternedString) -> Self
source§impl From<String> for EntityPathPart
impl From<String> for EntityPathPart
source§impl FromIterator<EntityPathPart> for EntityPath
impl FromIterator<EntityPathPart> for EntityPath
source§fn from_iter<T: IntoIterator<Item = EntityPathPart>>(parts: T) -> Self
fn from_iter<T: IntoIterator<Item = EntityPathPart>>(parts: T) -> Self
source§impl Hash for EntityPathPart
impl Hash for EntityPathPart
source§impl Ord for EntityPathPart
impl Ord for EntityPathPart
source§impl PartialEq for EntityPathPart
impl PartialEq for EntityPathPart
source§fn eq(&self, other: &EntityPathPart) -> bool
fn eq(&self, other: &EntityPathPart) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for EntityPathPart
impl PartialOrd for EntityPathPart
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for EntityPathPart
impl Serialize for EntityPathPart
impl Eq for EntityPathPart
impl StructuralPartialEq for EntityPathPart
Auto Trait Implementations§
impl Freeze for EntityPathPart
impl RefUnwindSafe for EntityPathPart
impl Send for EntityPathPart
impl Sync for EntityPathPart
impl Unpin for EntityPathPart
impl UnwindSafe for EntityPathPart
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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<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>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more