pub struct ClassGroup {
pub index: usize,
pub label: Cow<'static, str>,
/* private fields */
}Expand description
One group on a ClassGroupBreakdown.
Class-group breakdowns partition the class-id space into named
subsets — e.g., {"vehicles": [3, 6, 8], "animals": [16, 17, 18]}
for a semantic-segmentation rollup. Unlike Bucket (closed
[lo, hi] over f64), a ClassGroup is a discrete set of
class ids with strict partition discipline at the breakdown level.
class_ids is private behind Self::class_ids so the
sorted-unique invariant established by Self::new is preserved
post-construction — it’s load-bearing for the binary search in
ClassGroupBreakdown::group_of and for deterministic hashing in
the future per-paradigm params_hash.
Fields§
§index: usizePosition on the group axis. Dense 0..groups.len().
label: Cow<'static, str>Human-readable label (e.g., "vehicles").
Implementations§
Source§impl ClassGroup
impl ClassGroup
Sourcepub fn new(
index: usize,
label: impl Into<Cow<'static, str>>,
class_ids: impl IntoIterator<Item = u32>,
) -> Self
pub fn new( index: usize, label: impl Into<Cow<'static, str>>, class_ids: impl IntoIterator<Item = u32>, ) -> Self
Constructor that sorts and dedups class_ids. The user-facing
validators (FFI / Python __post_init__) reject duplicates
up-front; this dedup is defensive belt-and-suspenders for
internal callers.
Trait Implementations§
Source§impl Clone for ClassGroup
impl Clone for ClassGroup
Source§fn clone(&self) -> ClassGroup
fn clone(&self) -> ClassGroup
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClassGroup
impl Debug for ClassGroup
Source§impl PartialEq for ClassGroup
impl PartialEq for ClassGroup
Source§fn eq(&self, other: &ClassGroup) -> bool
fn eq(&self, other: &ClassGroup) -> bool
self and other values to be equal, and is used by ==.impl Eq for ClassGroup
impl StructuralPartialEq for ClassGroup
Auto Trait Implementations§
impl Freeze for ClassGroup
impl RefUnwindSafe for ClassGroup
impl Send for ClassGroup
impl Sync for ClassGroup
impl Unpin for ClassGroup
impl UnsafeUnpin for ClassGroup
impl UnwindSafe for ClassGroup
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.