Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
Transformed in datafusion_common::tree_node - Rust
[go: Go Back, main page]

Struct datafusion_common::tree_node::Transformed

source ·
pub struct Transformed<T> {
    pub data: T,
    pub transformed: bool,
    pub tnr: TreeNodeRecursion,
}
Expand description

Result of tree walk / transformation APIs

API users control the transformation by returning:

  • The resulting (possibly transformed) node,
  • transformed: flag indicating whether any change was made to the node
  • tnr: TreeNodeRecursion specifying how to proceed with the recursion.

At the end of the transformation, the return value will contain:

  • The final (possibly transformed) tree,
  • transformed: flag indicating whether any change was made to the node
  • tnr: TreeNodeRecursion specifying how the recursion ended.

Example APIs:

Fields§

§data: T§transformed: bool§tnr: TreeNodeRecursion

Implementations§

source§

impl<T> Transformed<T>

source

pub fn new(data: T, transformed: bool, tnr: TreeNodeRecursion) -> Self

Create a new Transformed object with the given information.

source

pub fn yes(data: T) -> Self

Wrapper for transformed data with TreeNodeRecursion::Continue statement.

source

pub fn no(data: T) -> Self

Wrapper for unchanged data with TreeNodeRecursion::Continue statement.

source

pub fn update_data<U, F: FnOnce(T) -> U>(self, f: F) -> Transformed<U>

Applies an infallible f to the data of this Transformed object, without modifying the transformed flag.

source

pub fn map_data<U, F: FnOnce(T) -> Result<U>>( self, f: F, ) -> Result<Transformed<U>>

Applies a fallible f (returns Result) to the data of this Transformed object, without modifying the transformed flag.

source

pub fn transform_data<U, F: FnOnce(T) -> Result<Transformed<U>>>( self, f: F, ) -> Result<Transformed<U>>

Applies a fallible transforming f to the data of this Transformed object.

The returned Transformed object has the transformed flag set if either self or the return value of f have the transformed flag set.

source

pub fn transform_children<F: FnOnce(T) -> Result<Transformed<T>>>( self, f: F, ) -> Result<Transformed<T>>

Maps the Transformed object to the result of the given f depending on the current TreeNodeRecursion value and the fact that f is changing the current node’s children.

source

pub fn transform_sibling<F: FnOnce(T) -> Result<Transformed<T>>>( self, f: F, ) -> Result<Transformed<T>>

Maps the Transformed object to the result of the given f depending on the current TreeNodeRecursion value and the fact that f is changing the current node’s sibling.

source

pub fn transform_parent<F: FnOnce(T) -> Result<Transformed<T>>>( self, f: F, ) -> Result<Transformed<T>>

Maps the Transformed object to the result of the given f depending on the current TreeNodeRecursion value and the fact that f is changing the current node’s parent.

Trait Implementations§

source§

impl<T: Debug> Debug for Transformed<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: PartialEq> PartialEq for Transformed<T>

source§

fn eq(&self, other: &Transformed<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> StructuralPartialEq for Transformed<T>

Auto Trait Implementations§

§

impl<T> Freeze for Transformed<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Transformed<T>
where T: RefUnwindSafe,

§

impl<T> Send for Transformed<T>
where T: Send,

§

impl<T> Sync for Transformed<T>
where T: Sync,

§

impl<T> Unpin for Transformed<T>
where T: Unpin,

§

impl<T> UnwindSafe for Transformed<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,