pub enum Value {
String(String),
Tuple(Vec<(String, Value)>),
List(Vec<Value>),
}Expand description
A parsed MI value.
Variants§
String(String)
A C-string constant, with escapes already decoded.
Tuple(Vec<(String, Value)>)
A {key=value,...} tuple.
List(Vec<Value>)
A [...] list.
Implementations§
Source§impl Value
impl Value
Sourcepub fn get(&self, key: &str) -> Option<&Value>
pub fn get(&self, key: &str) -> Option<&Value>
Looks up key in a tuple, returning the first match.
Sourcepub fn get_int(&self, key: &str) -> Option<i64>
pub fn get_int(&self, key: &str) -> Option<i64>
Looks up key and parses it as a decimal integer.
Sourcepub fn get_address(&self, key: &str) -> Option<u64>
pub fn get_address(&self, key: &str) -> Option<u64>
Looks up key and parses it as an address.
Accepts the 0x-prefixed form GDB uses everywhere, and plain decimal.
Sourcepub fn elements_named(&self, name: &str) -> Vec<&Value>
pub fn elements_named(&self, name: &str) -> Vec<&Value>
The elements of a list that are single-entry tuples keyed by name.
This is how repeated-key lists such as stack=[frame={...},frame={...}]
are read back.
Sourcepub fn items(&self, name: &str) -> Vec<&Value>
pub fn items(&self, name: &str) -> Vec<&Value>
List elements, treating a repeated-key list as a plain list.
GDB is inconsistent about which of the two list shapes it uses for the same conceptual data across versions, so callers that just want “the items” should use this rather than choosing a shape and being wrong on some GDB release.
Trait Implementations§
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more