#[non_exhaustive]pub enum SpaceKind {
Unknown,
Function,
Class,
Struct,
Trait,
Impl,
Unit,
Namespace,
Interface,
}Expand description
The list of supported space kinds.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unknown
An unknown space
Function
A function space
Class
A class space
Struct
A struct space
Trait
A Rust trait space
Impl
A Rust implementation space
Unit
A general space
Namespace
A C/C++ namespace
Interface
An interface
Implementations§
Source§impl SpaceKind
impl SpaceKind
Sourcepub fn from_serialized(serialized: &str) -> Self
pub fn from_serialized(serialized: &str) -> Self
Parse a SpaceKind from its lowercase serialized form — the
#[serde(rename_all = "lowercase")] representation that appears in
the JSON / wire kind field. An unrecognized string maps to
SpaceKind::Unknown so a JSON-walking front-end degrades
gracefully on a future kind rather than erroring.
This is the single source of truth for the string-to-kind mapping a
consumer needs when it reads a serialized kind (the Python
to_sarif binding uses it to apply per-metric threshold scope via
crate::metric_catalog::MetricScope::admits). A round-trip test
pins it against the serde representation so the two cannot drift.
Trait Implementations§
impl Copy for SpaceKind
Source§impl<'de> Deserialize<'de> for SpaceKind
impl<'de> Deserialize<'de> for SpaceKind
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>,
impl Eq for SpaceKind
impl StructuralPartialEq for SpaceKind
Auto Trait Implementations§
impl Freeze for SpaceKind
impl RefUnwindSafe for SpaceKind
impl Send for SpaceKind
impl Sync for SpaceKind
impl Unpin for SpaceKind
impl UnsafeUnpin for SpaceKind
impl UnwindSafe for SpaceKind
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.