pub enum IntegerValues<'a> {
I32(DeviceArrayView<'a, i32>),
I64(DeviceArrayView<'a, i64>),
}Expand description
Runtime-typed integer values from algorithm results.
This is used for integer-valued outputs that are not necessarily graph vertex IDs, such as component labels, core numbers, and triangle counts.
Variants§
I32(DeviceArrayView<'a, i32>)
Values stored as 32-bit signed integers.
I64(DeviceArrayView<'a, i64>)
Values stored as 64-bit signed integers.
Implementations§
Source§impl IntegerValues<'_>
impl IntegerValues<'_>
Source§impl<'a> IntegerValues<'a>
impl<'a> IntegerValues<'a>
Sourcepub fn to_vec_i64(&self, handle: &EnteredContext<'_>) -> Result<Vec<i64>>
pub fn to_vec_i64(&self, handle: &EnteredContext<'_>) -> Result<Vec<i64>>
Copy to host as Vec<i64>, widening i32 values if needed.
Sourcepub fn to_vec_i32(&self, handle: &EnteredContext<'_>) -> Result<Vec<i32>>
pub fn to_vec_i32(&self, handle: &EnteredContext<'_>) -> Result<Vec<i32>>
Copy to host as Vec<i32>.
Returns an error if the underlying values are i64, since narrowing
could lose data.
Sourcepub fn as_i32(&self) -> Option<&DeviceArrayView<'a, i32>>
pub fn as_i32(&self) -> Option<&DeviceArrayView<'a, i32>>
Get the inner view as &DeviceArrayView<i32>, or None if i64.
Sourcepub fn as_i64(&self) -> Option<&DeviceArrayView<'a, i64>>
pub fn as_i64(&self) -> Option<&DeviceArrayView<'a, i64>>
Get the inner view as &DeviceArrayView<i64>, or None if i32.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Send for IntegerValues<'a>
impl<'a> !Sync for IntegerValues<'a>
impl<'a> Freeze for IntegerValues<'a>
impl<'a> RefUnwindSafe for IntegerValues<'a>
impl<'a> Unpin for IntegerValues<'a>
impl<'a> UnsafeUnpin for IntegerValues<'a>
impl<'a> UnwindSafe for IntegerValues<'a>
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