pub struct DescriptorSlot(/* private fields */);Expand description
A group-local descriptor lookup key. It carries no ownership authority.
§Examples
use tenferro_tensor::DescriptorSlot;
let slot = DescriptorSlot::from_index(3).unwrap();
assert_eq!(slot.index(), 3);Implementations§
Source§impl DescriptorSlot
impl DescriptorSlot
Sourcepub const fn index(self) -> usize
pub const fn index(self) -> usize
Return the zero-based descriptor index.
§Examples
use tenferro_tensor::DescriptorSlot;
let slot = DescriptorSlot::from_index(2).unwrap();
assert_eq!(slot.index(), 2);Sourcepub fn from_index(index: usize) -> Option<Self>
pub fn from_index(index: usize) -> Option<Self>
Convert a host index into a descriptor slot.
§Examples
use tenferro_tensor::DescriptorSlot;
assert_eq!(DescriptorSlot::from_index(1).unwrap().index(), 1);
assert!(DescriptorSlot::from_index(usize::MAX).is_none());Trait Implementations§
Source§impl Clone for DescriptorSlot
impl Clone for DescriptorSlot
Source§fn clone(&self) -> DescriptorSlot
fn clone(&self) -> DescriptorSlot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DescriptorSlot
Source§impl Debug for DescriptorSlot
impl Debug for DescriptorSlot
impl Eq for DescriptorSlot
Source§impl Hash for DescriptorSlot
impl Hash for DescriptorSlot
Source§impl PartialEq for DescriptorSlot
impl PartialEq for DescriptorSlot
impl StructuralPartialEq for DescriptorSlot
Auto Trait Implementations§
impl Freeze for DescriptorSlot
impl RefUnwindSafe for DescriptorSlot
impl Send for DescriptorSlot
impl Sync for DescriptorSlot
impl Unpin for DescriptorSlot
impl UnsafeUnpin for DescriptorSlot
impl UnwindSafe for DescriptorSlot
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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 more