Trait hwlocality::bitmap::SpecializedBitmap

source ·
pub trait SpecializedBitmap: AsRef<Bitmap> + Borrow<Self::Owned> + Debug + PartialEq + Sealed {
    type Owned: OwnedSpecializedBitmap;

    const BITMAP_KIND: BitmapKind;

    // Required method
    fn to_owned(&self) -> Self::Owned;
}
Expand description

A specialized bitmap (CpuSet, NodeSet) or a BitmapRef thereof

hwlocality avoids the need for error-prone hwloc-style BYNODESET flags by making CpuSet and NodeSet full-blown types, not typedefs. Functions which accept either of these specialized bitmap types can be made generic over this SpecializedBitmap trait, which can be used to query which specialized bitmap type was passed in.

Required Associated Types§

source

type Owned: OwnedSpecializedBitmap

Owned form of this specialized bitmap

Required Associated Constants§

source

const BITMAP_KIND: BitmapKind

Tag used to discriminate between specialized bitmaps in code

Required Methods§

source

fn to_owned(&self) -> Self::Owned

Construct an owned specialized bitmap from a borrowed one

This is a generalization of Clone that also works for BitmapRef.

Object Safety§

This trait is not object safe.

Implementors§