MCPcopy Create free account
hub / github.com/apache/datafusion / new_alternatives

Method new_alternatives

datafusion/physical-expr-common/src/sort_expr.rs:715–727  ·  view source on GitHub ↗

Creates a new instance from the given alternatives. If an empty list of alternatives are given, returns `None`.

(
        alternatives: impl IntoIterator<Item = LexRequirement>,
        soft: bool,
    )

Source from the content-addressed store, hash-verified

713 /// Creates a new instance from the given alternatives. If an empty list of
714 /// alternatives are given, returns `None`.
715 pub fn new_alternatives(
716 alternatives: impl IntoIterator<Item = LexRequirement>,
717 soft: bool,
718 ) -> Option<Self> {
719 let alternatives = alternatives.into_iter().collect::<Vec<_>>();
720 (!alternatives.is_empty()).then(|| {
721 if soft {
722 Self::Soft(alternatives)
723 } else {
724 Self::Hard(alternatives)
725 }
726 })
727 }
728
729 /// Creates a new instance with a single hard requirement.
730 pub fn new(requirement: LexRequirement) -> Self {

Callers

nothing calls this directly

Calls 2

into_iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected