pub enum Index {
Show 33 variants
Minute10,
Minute30,
Hour1,
Hour4,
Hour12,
Day1,
Day3,
Week1,
Month1,
Month3,
Month6,
Year1,
Year10,
Halving,
Epoch,
Height,
TxIndex,
TxInIndex,
TxOutIndex,
EmptyOutputIndex,
OpReturnIndex,
P2AAddrIndex,
P2MSOutputIndex,
P2PK33AddrIndex,
P2PK65AddrIndex,
P2PKHAddrIndex,
P2SHAddrIndex,
P2TRAddrIndex,
P2WPKHAddrIndex,
P2WSHAddrIndex,
UnknownOutputIndex,
FundedAddrIndex,
EmptyAddrIndex,
}Expand description
Aggregation dimension for querying series. Includes time-based (date, week, month, year), block-based (height, tx_index), and address/output type indexes.
Variants§
Minute10
Minute30
Hour1
Hour4
Hour12
Day1
Day3
Week1
Month1
Month3
Month6
Year1
Year10
Halving
Epoch
Height
TxIndex
TxInIndex
TxOutIndex
EmptyOutputIndex
OpReturnIndex
P2AAddrIndex
P2MSOutputIndex
P2PK33AddrIndex
P2PK65AddrIndex
P2PKHAddrIndex
P2SHAddrIndex
P2TRAddrIndex
P2WPKHAddrIndex
P2WSHAddrIndex
UnknownOutputIndex
FundedAddrIndex
EmptyAddrIndex
Implementations§
Source§impl Index
impl Index
pub const fn all() -> [Index; 33]
pub fn possible_values(&self) -> &'static [&'static str]
pub fn all_possible_values() -> Vec<&'static str>
pub fn name(&self) -> &'static str
Sourcepub const fn cache_class(&self) -> CacheClass
pub const fn cache_class(&self) -> CacheClass
Classifies how the trailing edge of an index mutates, so the series cache can pick the right stable-count strategy.
Sourcepub const fn is_date_based(&self) -> bool
pub const fn is_date_based(&self) -> bool
Returns true if this index type is date-based.
Sourcepub fn index_to_timestamp(&self, i: usize) -> Option<Timestamp>
pub fn index_to_timestamp(&self, i: usize) -> Option<Timestamp>
Convert an index value to a timestamp for time-based indexes. Returns None for non-time-based indexes.
Sourcepub fn date_to_index(&self, date: Date) -> Option<usize>
pub fn date_to_index(&self, date: Date) -> Option<usize>
Convert a date to an index value for day-precision or coarser indexes.
Returns None for sub-daily indexes (use timestamp_to_index instead),
non-date-based indexes, or dates before genesis.
Sourcepub fn timestamp_to_index(&self, ts: Timestamp) -> Option<usize>
pub fn timestamp_to_index(&self, ts: Timestamp) -> Option<usize>
Convert a timestamp to an index value for any date-based index. Works for both sub-daily (minute, hour) and daily+ indexes. Returns None for non-date-based indexes.
Sourcepub fn index_to_date(&self, i: usize) -> Option<Date>
pub fn index_to_date(&self, i: usize) -> Option<Date>
Convert an index value to a date for day-precision or coarser indexes.
Returns None for sub-daily indexes (use index_to_timestamp instead)
and non-date-based indexes.
Trait Implementations§
impl Copy for Index
Source§impl<'de> Deserialize<'de> for Index
impl<'de> Deserialize<'de> for Index
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Index, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Index, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for Index
Source§impl JsonSchema for Index
impl JsonSchema for Index
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for Index
impl Ord for Index
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Index
impl PartialOrd for Index
Source§impl Serialize for Index
impl Serialize for Index
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
impl UnwindSafe for Index
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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