pub struct Query<Q: QueryType> { /* private fields */ }Expand description
Represents a query for a specific batch identifier, received from a Collector as part of the collection flow.
Implementations§
Source§impl<Q: QueryType> Query<Q>
impl<Q: QueryType> Query<Q>
Sourcepub fn new(query_body: Q::QueryBody) -> Self
pub fn new(query_body: Q::QueryBody) -> Self
Constructs a new query from its components.
This method would typically be used for code which is generic over the query type.
Query-type specific code will typically call one of Self::new_time_interval or
Self::new_fixed_size.
Sourcepub fn query_body(&self) -> &Q::QueryBody
pub fn query_body(&self) -> &Q::QueryBody
Gets the query body included in this query.
This method would typically be used for code which is generic over the query type.
Query-type specific code will typically call one of Self::batch_interval or
Self::fixed_size_query.
Source§impl Query<TimeInterval>
impl Query<TimeInterval>
Sourcepub fn new_time_interval(batch_interval: Interval) -> Self
pub fn new_time_interval(batch_interval: Interval) -> Self
Constructs a new query for a time-interval task.
Sourcepub fn batch_interval(&self) -> &Interval
pub fn batch_interval(&self) -> &Interval
Gets the batch interval associated with this query.
Source§impl Query<FixedSize>
impl Query<FixedSize>
Sourcepub fn new_fixed_size(fixed_size_query: FixedSizeQuery) -> Self
pub fn new_fixed_size(fixed_size_query: FixedSizeQuery) -> Self
Constructs a new query for a fixed-size task.
Sourcepub fn fixed_size_query(&self) -> &FixedSizeQuery
pub fn fixed_size_query(&self) -> &FixedSizeQuery
Gets the fixed size query associated with this query.
Trait Implementations§
Source§impl<Q: QueryType> Decode for Query<Q>
impl<Q: QueryType> Decode for Query<Q>
Source§fn decode(bytes: &mut Cursor<&[u8]>) -> Result<Self, CodecError>
fn decode(bytes: &mut Cursor<&[u8]>) -> Result<Self, CodecError>
bytes. On success, the decoded value is returned
and bytes is advanced by the encoded size of the value. On failure, an error is returned
and no further attempt to read from bytes should be made.Source§fn get_decoded(bytes: &[u8]) -> Result<Self, CodecError>
fn get_decoded(bytes: &[u8]) -> Result<Self, CodecError>
Self::decode fails, or if
there are any bytes left in bytes after decoding a value.Source§impl<Q: QueryType> Encode for Query<Q>
impl<Q: QueryType> Encode for Query<Q>
Source§fn encode(&self, bytes: &mut Vec<u8>) -> Result<(), CodecError>
fn encode(&self, bytes: &mut Vec<u8>) -> Result<(), CodecError>
bytes, growing the vector as needed.Source§fn encoded_len(&self) -> Option<usize>
fn encoded_len(&self) -> Option<usize>
None by default.Source§fn get_encoded(&self) -> Result<Vec<u8>, CodecError>
fn get_encoded(&self) -> Result<Vec<u8>, CodecError>
Vec<u8>.impl<Q: Eq + QueryType> Eq for Query<Q>
impl<Q: QueryType> StructuralPartialEq for Query<Q>
Auto Trait Implementations§
impl<Q> Freeze for Query<Q>
impl<Q> RefUnwindSafe for Query<Q>
impl<Q> Send for Query<Q>
impl<Q> Sync for Query<Q>
impl<Q> Unpin for Query<Q>
impl<Q> UnwindSafe for Query<Q>
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<D, T> ParameterizedDecode<T> for D
impl<D, T> ParameterizedDecode<T> for D
Source§fn decode_with_param(
_decoding_parameter: &T,
bytes: &mut Cursor<&[u8]>,
) -> Result<D, CodecError>
fn decode_with_param( _decoding_parameter: &T, bytes: &mut Cursor<&[u8]>, ) -> Result<D, CodecError>
bytes. decoding_parameter provides details of the
wire encoding such as lengths of different portions of the message. On success, the decoded
value is returned and bytes is advanced by the encoded size of the value. On failure, an
error is returned and no further attempt to read from bytes should be made.Source§fn get_decoded_with_param(
decoding_parameter: &P,
bytes: &[u8],
) -> Result<Self, CodecError>
fn get_decoded_with_param( decoding_parameter: &P, bytes: &[u8], ) -> Result<Self, CodecError>
Self::decode_with_param
fails, or if there are any bytes left in bytes after decoding a value.Source§impl<E, T> ParameterizedEncode<T> for E
impl<E, T> ParameterizedEncode<T> for E
Source§fn encode_with_param(
&self,
_encoding_parameter: &T,
bytes: &mut Vec<u8>,
) -> Result<(), CodecError>
fn encode_with_param( &self, _encoding_parameter: &T, bytes: &mut Vec<u8>, ) -> Result<(), CodecError>
bytes, growing the vector as needed.
encoding_parameter provides details of the wire encoding, used to control how the value
is encoded.Source§fn encoded_len_with_param(&self, _encoding_parameter: &T) -> Option<usize>
fn encoded_len_with_param(&self, _encoding_parameter: &T) -> Option<usize>
None by default.Source§fn get_encoded_with_param(
&self,
encoding_parameter: &P,
) -> Result<Vec<u8>, CodecError>
fn get_encoded_with_param( &self, encoding_parameter: &P, ) -> Result<Vec<u8>, CodecError>
Vec<u8>.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.