pub enum MaybeEncoded<T> {
Encoded(Vec<u8>),
Decoded(T),
}Expand description
A value that a transport may either leave encoded or materialize in memory. Users are free to pass MaybeEncoded::Encoded or MaybeEncoded::Decoded at any moment and Distributed DataFusion’s code will internally know how to handle it.
Variants§
Implementations§
Source§impl MaybeEncoded<Arc<dyn ExecutionPlan>>
impl MaybeEncoded<Arc<dyn ExecutionPlan>>
Sourcepub fn encode(self, ctx: &Arc<TaskContext>) -> Result<Vec<u8>>
pub fn encode(self, ctx: &Arc<TaskContext>) -> Result<Vec<u8>>
Returns the encoded ExecutionPlan as protobuf bytes:
- If in
Decodedstate, it encodes it using the codecs registered in the TaskContext. - If in
Encodedstate, it just passes through the content.
Source§impl MaybeEncoded<Partitioning>
impl MaybeEncoded<Partitioning>
Sourcepub fn encode(self, ctx: &Arc<TaskContext>) -> Result<Vec<u8>>
pub fn encode(self, ctx: &Arc<TaskContext>) -> Result<Vec<u8>>
Returns the encoded Partitioning as protobuf bytes:
- If in
Decodedstate, it encodes it using the codecs registered in the TaskContext. - If in
Encodedstate, it just passes through the content.
Sourcepub fn decode(
self,
schema: SchemaRef,
task_ctx: &TaskContext,
) -> Result<Partitioning>
pub fn decode( self, schema: SchemaRef, task_ctx: &TaskContext, ) -> Result<Partitioning>
Returns the decoded Partitioning.
- If in
Decodedstate, it just passes through the content. - If in
Encodedstate, it decodes it using the codecs registered in the TaskContext.
Trait Implementations§
Source§impl<T: Clone> Clone for MaybeEncoded<T>
impl<T: Clone> Clone for MaybeEncoded<T>
Source§fn clone(&self) -> MaybeEncoded<T>
fn clone(&self) -> MaybeEncoded<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for MaybeEncoded<T>where
T: Freeze,
impl<T> RefUnwindSafe for MaybeEncoded<T>where
T: RefUnwindSafe,
impl<T> Send for MaybeEncoded<T>where
T: Send,
impl<T> Sync for MaybeEncoded<T>where
T: Sync,
impl<T> Unpin for MaybeEncoded<T>where
T: Unpin,
impl<T> UnsafeUnpin for MaybeEncoded<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for MaybeEncoded<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request