Skip to main content

DomainSet

Struct DomainSet 

Source
pub struct DomainSet(/* private fields */);
Expand description

A set of MemoryDomainKinds a producer can emit or a consumer can accept, packed into a bitmask. The allocation query negotiates a single concrete domain by intersecting the producer’s capability set with the consumer’s acceptance set and picking the most-preferred survivor (preferred). A single-domain producer/consumer (the default) is just only, so the negotiation reduces to today’s exact-match behavior; a multi-domain element (a decoder that can deliver to System or stay resident on the GPU) names every domain it can satisfy.

Implementations§

Source§

impl DomainSet

Source

pub const EMPTY: Self

The empty set: no domain. The intersection result that signals an irreconcilable conflict (producer and consumer share no domain).

Source

pub const ALL: Self

Every domain. The default input acceptance of an element (it imposes no domain requirement on its upstream), so the converter auto-plug only acts on elements that declare a narrower input_domains.

Source

pub fn iter(self) -> impl Iterator<Item = MemoryDomainKind>

Iterate the member domains in preference order (GPU-resident first).

Source

pub const fn only(k: MemoryDomainKind) -> Self

The singleton set holding just k. The default capability/acceptance of every element, derived from its single output_memory().

Source

pub const fn with(self, k: MemoryDomainKind) -> Self

This set with k added.

Source

pub const fn contains(self, k: MemoryDomainKind) -> bool

Whether k is a member.

Source

pub const fn intersect(self, other: Self) -> Self

The set of domains in both self and other (the domains a producer and consumer can agree on).

Source

pub const fn union(self, other: Self) -> Self

The set of domains in either self or other.

Source

pub const fn is_empty(self) -> bool

Whether the set holds no domain.

Source

pub fn preferred(self) -> Option<MemoryDomainKind>

The most-preferred member per [DOMAIN_PREFERENCE] (GPU-resident before System), or None if the set is empty. The single concrete domain the negotiation settles on.

Trait Implementations§

Source§

impl Clone for DomainSet

Source§

fn clone(&self) -> DomainSet

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DomainSet

Source§

impl Debug for DomainSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DomainSet

Source§

impl PartialEq for DomainSet

Source§

fn eq(&self, other: &DomainSet) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DomainSet

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ElementBound for T
where T: Send,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.