pub struct Duration<U> { /* private fields */ }Expand description
Marker for an arrow Duration column, e.g. Duration<Nanosecond>.
The values are raw i64 ticks in the given TimeUnitSpec.
use quiver::{Column, Duration, Millisecond};
let column = Column::<Duration<Millisecond>>::from_values([10, 20]);
assert_eq!(column.value(1), 20); // elapsed millisecondsThis type is never instantiated — it only appears as a type parameter.
Trait Implementations§
Source§impl<U> ConcreteType for Duration<U>where
U: TimeUnitSpec + 'static,
impl<U> ConcreteType for Duration<U>where
U: TimeUnitSpec + 'static,
impl<U> InfallibleBuild for Duration<U>where
U: TimeUnitSpec + 'static,
Source§impl<U> LogicalType for Duration<U>where
U: TimeUnitSpec + 'static,
impl<U> LogicalType for Duration<U>where
U: TimeUnitSpec + 'static,
Source§type Typed = PrimitiveArray<<U as TimeUnitSpec>::DurationType>
type Typed = PrimitiveArray<<U as TimeUnitSpec>::DurationType>
The fully-downcast, validated representation of one column of this datatype.
Cheap to clone (arrow arrays are reference-counted).
Source§type Value<'a> = i64
where
Duration<U>: 'a
type Value<'a> = i64 where Duration<U>: 'a
Zero-copy element view:
&'a str for Utf8, i64 for i64,
an iterator for List<T>, Option<…> for Option<T>.Source§type Owned = i64
type Owned = i64
The owned value of one element, used by the convenience constructors:
String for Utf8, Option<i64> for Option<i64>, Vec<…> for List<…>, etc.Source§fn downcast(
array: &dyn Array,
) -> Result<<Duration<U> as LogicalType>::Typed, ColumnError>
fn downcast( array: &dyn Array, ) -> Result<<Duration<U> as LogicalType>::Typed, ColumnError>
Validates that
array has an acceptable datatype, then recursively
downcasts it — checking the nulls of all children along the way. Read moreSource§fn is_null(typed: &<Duration<U> as LogicalType>::Typed, index: usize) -> bool
fn is_null(typed: &<Duration<U> as LogicalType>::Typed, index: usize) -> bool
Is the value at
index null?Source§fn value(
typed: &<Duration<U> as LogicalType>::Typed,
index: usize,
) -> <Duration<U> as LogicalType>::Value<'_>
fn value( typed: &<Duration<U> as LogicalType>::Typed, index: usize, ) -> <Duration<U> as LogicalType>::Value<'_>
The value at
index. Read moreSource§fn to_owned_value(
value: <Duration<U> as LogicalType>::Value<'_>,
) -> <Duration<U> as LogicalType>::Owned
fn to_owned_value( value: <Duration<U> as LogicalType>::Value<'_>, ) -> <Duration<U> as LogicalType>::Owned
Converts a borrowed element value into an owned one,
e.g.
&str → String.Source§impl<U> PrimitiveType for Duration<U>where
U: TimeUnitSpec + 'static,
impl<U> PrimitiveType for Duration<U>where
U: TimeUnitSpec + 'static,
Auto Trait Implementations§
impl<U> Freeze for Duration<U>
impl<U> RefUnwindSafe for Duration<U>
impl<U> Send for Duration<U>
impl<U> Sync for Duration<U>
impl<U> Unpin for Duration<U>
impl<U> UnsafeUnpin for Duration<U>
impl<U> UnwindSafe for Duration<U>
Blanket Implementations§
impl<T> Allocation for T
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