pub struct TypedBatch<K, V, R, B> { /* private fields */ }Expand description
A statically typed wrapper around a dynamically typed batch B with concrete key, value, and
weight types K, V, and R respectively.
Implementations§
Source§impl<K, V, R, B> TypedBatch<K, V, R, B>
impl<K, V, R, B> TypedBatch<K, V, R, B>
Source§impl<K, V, R, B> TypedBatch<K, V, R, B>
impl<K, V, R, B> TypedBatch<K, V, R, B>
Sourcepub fn from_tuples(time: B::Time, tuples: Vec<Tup2<Tup2<K, V>, R>>) -> Self
pub fn from_tuples(time: B::Time, tuples: Vec<Tup2<Tup2<K, V>, R>>) -> Self
Build a batch out of tuples.
pub fn merge_batches<I>(batches: I) -> Selfwhere
I: IntoIterator<Item = Self>,
Source§impl<K, V, R, B> TypedBatch<K, V, R, B>
impl<K, V, R, B> TypedBatch<K, V, R, B>
pub fn into_inner(self) -> B
Source§impl<K, R, B> TypedBatch<K, (), R, B>
impl<K, R, B> TypedBatch<K, (), R, B>
Source§impl<K, V, R, B> TypedBatch<K, V, R, DynSpineSnapshot<B>>
impl<K, V, R, B> TypedBatch<K, V, R, DynSpineSnapshot<B>>
Sourcepub fn concat<'a, I>(snapshots: I) -> TypedBatch<K, V, R, DynSpineSnapshot<B>>where
I: IntoIterator<Item = &'a Self>,
pub fn concat<'a, I>(snapshots: I) -> TypedBatch<K, V, R, DynSpineSnapshot<B>>where
I: IntoIterator<Item = &'a Self>,
Concatenate a list of snapshots into a single snapshot.
Sourcepub fn consolidate(&self) -> TypedBatch<K, V, R, B>
pub fn consolidate(&self) -> TypedBatch<K, V, R, B>
Consolidate the batches in the snapshot.
Source§impl<K, V, R, B> TypedBatch<K, V, R, B>
impl<K, V, R, B> TypedBatch<K, V, R, B>
Sourcepub fn consolidate(self) -> TypedBatch<K, V, R, B::Batch>
pub fn consolidate(self) -> TypedBatch<K, V, R, B::Batch>
Consolidate the batches in the trace.
Source§impl<K, V, R, B> TypedBatch<K, V, R, DynSpine<B>>
impl<K, V, R, B> TypedBatch<K, V, R, DynSpine<B>>
pub fn ro_snapshot(&self) -> TypedBatch<K, V, R, DynSpineSnapshot<B>>
Trait Implementations§
Source§impl<K, V, R, B> AddAssignByRef for TypedBatch<K, V, R, B>
impl<K, V, R, B> AddAssignByRef for TypedBatch<K, V, R, B>
fn add_assign_by_ref(&mut self, other: &Self)
Source§impl<K, V, R, B> AddByRef for TypedBatch<K, V, R, B>
impl<K, V, R, B> AddByRef for TypedBatch<K, V, R, B>
fn add_by_ref(&self, other: &Self) -> Self
Source§impl<K, V, R, B> BatchReader for TypedBatch<K, V, R, B>
impl<K, V, R, B> BatchReader for TypedBatch<K, V, R, B>
type Inner = B
Source§type IntoBatch = <B as WithSnapshot>::Batch
type IntoBatch = <B as WithSnapshot>::Batch
Any batch reader can be decomposed into a list of batches. This type represents the
type of the batches: Read more
type Time = <B as BatchReader>::Time
Source§type DynR = <B as BatchReader>::R
type DynR = <B as BatchReader>::R
Dynamic weight type (e.g.,
DynZWeight).fn inner_mut(&mut self) -> &mut Self::Inner
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Drop the statically typed wrapper and return the inner dynamic batch type.
Source§fn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Create a statically typed wrapper around
inner.Source§fn stream_inner<C: Clone>(stream: &Stream<C, Self>) -> Stream<C, B>
fn stream_inner<C: Clone>(stream: &Stream<C, Self>) -> Stream<C, B>
Convert a stream of batches of statically typed batches of type
Self into a stream
of dynamically typed batches Self::Inner batches. Read moreSource§fn stream_from_inner<C: Clone>(
stream: &Stream<C, Self::Inner>,
) -> Stream<C, Self>
fn stream_from_inner<C: Clone>( stream: &Stream<C, Self::Inner>, ) -> Stream<C, Self>
Convert a stream of dynamically typed batches of type
Self::Inner into a stream
of statically typed batches of type Self.Source§fn into_dyn_batches(self) -> Vec<Arc<Self::IntoBatch>>
fn into_dyn_batches(self) -> Vec<Arc<Self::IntoBatch>>
Consume
self and returns the list of dynamically typed batches comprising it.Source§fn into_dyn_snapshot(self) -> DynSpineSnapshot<Self::IntoBatch>
fn into_dyn_snapshot(self) -> DynSpineSnapshot<Self::IntoBatch>
Convert
self into a spine snapshot.Source§fn into_batches(
self,
) -> Vec<Arc<TypedBatch<Self::Key, Self::Val, Self::R, Self::IntoBatch>>>
fn into_batches( self, ) -> Vec<Arc<TypedBatch<Self::Key, Self::Val, Self::R, Self::IntoBatch>>>
Consume
self and returns the list of statically typed batches comprising it.Source§fn dyn_batches(&self) -> Vec<Arc<Self::IntoBatch>>
fn dyn_batches(&self) -> Vec<Arc<Self::IntoBatch>>
Returns the list of dynamically typed batches comprising
self.Source§fn batches(
&self,
) -> Vec<Arc<TypedBatch<Self::Key, Self::Val, Self::R, Self::IntoBatch>>>
fn batches( &self, ) -> Vec<Arc<TypedBatch<Self::Key, Self::Val, Self::R, Self::IntoBatch>>>
Returns the list of statically typed batches comprising
self.Source§fn dyn_snapshot(&self) -> DynSpineSnapshot<Self::IntoBatch>
fn dyn_snapshot(&self) -> DynSpineSnapshot<Self::IntoBatch>
Assemble batches from
self into a spine snapshot.fn into_batch_factories() -> <Self::IntoBatch as DynBatchReader>::Factories
Source§impl<K, V, R, B> Checkpoint for TypedBatch<K, V, R, B>
impl<K, V, R, B> Checkpoint for TypedBatch<K, V, R, B>
Source§impl<K: Clone, V: Clone, R: Clone, B: Clone> Clone for TypedBatch<K, V, R, B>
impl<K: Clone, V: Clone, R: Clone, B: Clone> Clone for TypedBatch<K, V, R, B>
Source§fn clone(&self) -> TypedBatch<K, V, R, B>
fn clone(&self) -> TypedBatch<K, V, R, B>
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 moreSource§impl<K, V, R, B> Debug for TypedBatch<K, V, R, B>where
B: Debug,
impl<K, V, R, B> Debug for TypedBatch<K, V, R, B>where
B: Debug,
Source§impl<K, V, R, B> Default for TypedBatch<K, V, R, B>
impl<K, V, R, B> Default for TypedBatch<K, V, R, B>
Source§impl<K, V, R, B> Deref for TypedBatch<K, V, R, B>
impl<K, V, R, B> Deref for TypedBatch<K, V, R, B>
Source§impl<K, V, R, B> DerefMut for TypedBatch<K, V, R, B>
impl<K, V, R, B> DerefMut for TypedBatch<K, V, R, B>
impl<K: Eq, V: Eq, R: Eq, B: Eq> Eq for TypedBatch<K, V, R, B>
Source§impl<K, V, R, B> HasZero for TypedBatch<K, V, R, B>
impl<K, V, R, B> HasZero for TypedBatch<K, V, R, B>
Source§impl<K, V, R, B> Neg for TypedBatch<K, V, R, B>
impl<K, V, R, B> Neg for TypedBatch<K, V, R, B>
Source§impl<K, V, R, B> NegByRef for TypedBatch<K, V, R, B>
impl<K, V, R, B> NegByRef for TypedBatch<K, V, R, B>
fn neg_by_ref(&self) -> Self
Source§impl<K, V, R, B> NumEntries for TypedBatch<K, V, R, B>
impl<K, V, R, B> NumEntries for TypedBatch<K, V, R, B>
Source§const CONST_NUM_ENTRIES: Option<usize> = B::CONST_NUM_ENTRIES
const CONST_NUM_ENTRIES: Option<usize> = B::CONST_NUM_ENTRIES
Returns
Some(n) if Self has constant size or None otherwise.Source§fn num_entries_shallow(&self) -> usize
fn num_entries_shallow(&self) -> usize
Returns the number of entries in
self.Source§fn num_entries_deep(&self) -> usize
fn num_entries_deep(&self) -> usize
Recursively computes the number of entries in a container by
calling this method on each entry in
self. Read moreSource§impl<K, V, R, B, B2> PartialEq<TypedBatch<K, V, R, B2>> for TypedBatch<K, V, R, B>where
B: PartialEq<B2>,
impl<K, V, R, B, B2> PartialEq<TypedBatch<K, V, R, B2>> for TypedBatch<K, V, R, B>where
B: PartialEq<B2>,
Source§fn eq(&self, other: &TypedBatch<K, V, R, B2>) -> bool
fn eq(&self, other: &TypedBatch<K, V, R, B2>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<K, V, R, B> SizeOf for TypedBatch<K, V, R, B>
impl<K, V, R, B> SizeOf for TypedBatch<K, V, R, B>
Source§fn size_of_children(&self, context: &mut Context)
fn size_of_children(&self, context: &mut Context)
Gets the size of all “children” owned by this value, not including the
size of the value itself. Read more
Source§fn size_of_with_context(&self, context: &mut Context)
fn size_of_with_context(&self, context: &mut Context)
Adds the size of the current value to the given
Context,
including both the size of the value itself and all of its childrenSource§impl<R, T> SourceOperator<TypedBatch<T, (), i64, FallbackWSet<dyn Data, dyn WeightTyped<Type = i64>>>> for CsvSource<R, T>
impl<R, T> SourceOperator<TypedBatch<T, (), i64, FallbackWSet<dyn Data, dyn WeightTyped<Type = i64>>>> for CsvSource<R, T>
Auto Trait Implementations§
impl<K, V, R, B> Freeze for TypedBatch<K, V, R, B>where
B: Freeze,
impl<K, V, R, B> RefUnwindSafe for TypedBatch<K, V, R, B>where
B: RefUnwindSafe,
impl<K, V, R, B> Send for TypedBatch<K, V, R, B>where
B: Send,
impl<K, V, R, B> Sync for TypedBatch<K, V, R, B>where
B: Sync,
impl<K, V, R, B> Unpin for TypedBatch<K, V, R, B>where
B: Unpin,
impl<K, V, R, B> UnsafeUnpin for TypedBatch<K, V, R, B>where
B: UnsafeUnpin,
impl<K, V, R, B> UnwindSafe for TypedBatch<K, V, R, B>where
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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,
impl<R> CryptoRng for R
impl<T> CryptoRng for T
impl<T> Data for Twhere
T: Clone + 'static,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load.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§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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Formattable for T
impl<T> GroupValue for T
Source§impl<Z> IndexedZSet for Zwhere
Z: Batch<R = i64, DynR = dyn WeightTyped<Type = i64>, Time = ()>,
<Z as Batch>::InnerBatch: IndexedZSet,
impl<Z> IndexedZSet for Zwhere
Z: Batch<R = i64, DynR = dyn WeightTyped<Type = i64>, Time = ()>,
<Z as Batch>::InnerBatch: IndexedZSet,
type InnerIndexedZSet = <Z as Batch>::InnerBatch
Source§impl<Z> IndexedZSetReader for Z
impl<Z> IndexedZSetReader for Z
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
impl<T> MonoidValue for Twhere
T: SemigroupValue + HasZero,
impl<T> Parsable for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
👎Deprecated since 0.9.0:
Renamed to random to avoid conflict with the new gen keyword in Rust 2024.
Alias for
Rng::random.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
👎Deprecated since 0.9.0:
Renamed to random_range
Alias for
Rng::random_range.impl<R> RngCore for Rwhere
R: Rng,
Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
impl<T> SemigroupValue for T
impl<R> TryCryptoRng for R
impl<R> TryCryptoRng for R
Source§impl<R> TryRng for R
impl<R> TryRng for R
Source§impl<R> TryRngCore for Rwhere
R: TryRng,
impl<R> TryRngCore for Rwhere
R: TryRng,
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a RNG error.
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
Return the next random
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
Return the next random
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
Fill
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
Wrap RNG with the
UnwrapMut wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
Convert an
RngCore to a RngReadAdapter.