pub struct Splat<T> { /* private fields */ }Expand description
Splat argument.
This is a marker trait that is used as a wrapper around tuples of arguments allowing to invoke a function with multiple arguments as if it were a single argument. Its purpose is to make writing operators with multiple arguments more ergonomic, which is particularly useful for joins.
All function traits implement variations of Splat for tuples of up to 8
elements, which is likely to be sufficient for most use cases. Please note
that most of the time, this type is only ever needed for creating flexible
operator functions, so you’ll rarely want to use it directly. Additionally,
note that Splat itself doesn’t impose any trait bounds in order to not
require even more trait bounds in the signature of implementors. Moreover,
it doesn’t implement Value, meaning it can only be used temporarily
inside operators, but never returned.
§Examples
use zrx_stream::function::Splat;
// Create splat from tuple
let splat = Splat::from((1, 2));Implementations§
Source§impl<T> Splat<T>
impl<T> Splat<T>
Sourcepub fn inner(&self) -> &T
pub fn inner(&self) -> &T
Returns the inner tuple of arguments.
§Examples
use zrx_stream::function::Splat;
// Create splat from tuple
let splat = Splat::from((1, 2));
assert_eq!(splat.inner(), &(1, 2));Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Returns the inner tuple of arguments, consuming the splat.
§Examples
use zrx_stream::function::Splat;
// Create splat from tuple
let splat = Splat::from((1, 2));
assert_eq!(splat.into_inner(), (1, 2));Source§impl<T> Splat<T>
impl<T> Splat<T>
Sourcepub fn from_ref(inner: &T) -> &Self
pub fn from_ref(inner: &T) -> &Self
Creates a splat argument from a reference to a tuple.
This method converts &T to &Splat<T>, which allows us to use splat
arguments in any function that takes a reference to a value T without
cloning the value. While the conversion mandates the use of unsafe,
it’s safe due to identical memory layout guarantees.
§Examples
use zrx_stream::function::Splat;
// Create splat from tuple reference
let splat = Splat::from_ref(&(1, 2));Trait Implementations§
Source§impl<F, R, I, T1, T2, T3> FilterFn<I, Splat<(T1, T2, T3)>> for F
impl<F, R, I, T1, T2, T3> FilterFn<I, Splat<(T1, T2, T3)>> for F
Source§impl<F, R, I, T1, T2, T3, T4> FilterFn<I, Splat<(T1, T2, T3, T4)>> for F
impl<F, R, I, T1, T2, T3, T4> FilterFn<I, Splat<(T1, T2, T3, T4)>> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5> FilterFn<I, Splat<(T1, T2, T3, T4, T5)>> for F
impl<F, R, I, T1, T2, T3, T4, T5> FilterFn<I, Splat<(T1, T2, T3, T4, T5)>> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6> FilterFn<I, Splat<(T1, T2, T3, T4, T5, T6)>> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6> FilterFn<I, Splat<(T1, T2, T3, T4, T5, T6)>> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7> FilterFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7> FilterFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8> FilterFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8> FilterFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>> for F
Source§impl<F, R, I, T1, U> FilterMapFn<I, Splat<(T1,)>, U> for F
impl<F, R, I, T1, U> FilterMapFn<I, Splat<(T1,)>, U> for F
Source§impl<F, R, I, T1, T2, U> FilterMapFn<I, Splat<(T1, T2)>, U> for F
impl<F, R, I, T1, T2, U> FilterMapFn<I, Splat<(T1, T2)>, U> for F
Source§impl<F, R, I, T1, T2, T3, U> FilterMapFn<I, Splat<(T1, T2, T3)>, U> for F
impl<F, R, I, T1, T2, T3, U> FilterMapFn<I, Splat<(T1, T2, T3)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, U> FilterMapFn<I, Splat<(T1, T2, T3, T4)>, U> for F
impl<F, R, I, T1, T2, T3, T4, U> FilterMapFn<I, Splat<(T1, T2, T3, T4)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, U> FilterMapFn<I, Splat<(T1, T2, T3, T4, T5)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, U> FilterMapFn<I, Splat<(T1, T2, T3, T4, T5)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, U> FilterMapFn<I, Splat<(T1, T2, T3, T4, T5, T6)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, U> FilterMapFn<I, Splat<(T1, T2, T3, T4, T5, T6)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, U> FilterMapFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>, U> for Fwhere
F: Fn(T1, T2, T3, T4, T5, T6, T7) -> R + Send + 'static,
R: IntoReport<Option<U>>,
I: Display,
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, U> FilterMapFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>, U> for Fwhere
F: Fn(T1, T2, T3, T4, T5, T6, T7) -> R + Send + 'static,
R: IntoReport<Option<U>>,
I: Display,
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8, U> FilterMapFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>, U> for Fwhere
F: Fn(T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + 'static,
R: IntoReport<Option<U>>,
I: Display,
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8, U> FilterMapFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>, U> for Fwhere
F: Fn(T1, T2, T3, T4, T5, T6, T7, T8) -> R + Send + 'static,
R: IntoReport<Option<U>>,
I: Display,
Source§impl<F, R, I, T1, T2, T3> InspectFn<I, Splat<(T1, T2, T3)>> for F
impl<F, R, I, T1, T2, T3> InspectFn<I, Splat<(T1, T2, T3)>> for F
Source§impl<F, R, I, T1, T2, T3, T4> InspectFn<I, Splat<(T1, T2, T3, T4)>> for F
impl<F, R, I, T1, T2, T3, T4> InspectFn<I, Splat<(T1, T2, T3, T4)>> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5> InspectFn<I, Splat<(T1, T2, T3, T4, T5)>> for F
impl<F, R, I, T1, T2, T3, T4, T5> InspectFn<I, Splat<(T1, T2, T3, T4, T5)>> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6> InspectFn<I, Splat<(T1, T2, T3, T4, T5, T6)>> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6> InspectFn<I, Splat<(T1, T2, T3, T4, T5, T6)>> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7> InspectFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7> InspectFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8> InspectFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8> InspectFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>> for F
Source§impl<F, R, I, T1, T2, T3, U> LiftFn<I, Splat<(T1, T2, T3)>, U> for F
impl<F, R, I, T1, T2, T3, U> LiftFn<I, Splat<(T1, T2, T3)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, U> LiftFn<I, Splat<(T1, T2, T3, T4)>, U> for F
impl<F, R, I, T1, T2, T3, T4, U> LiftFn<I, Splat<(T1, T2, T3, T4)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, U> LiftFn<I, Splat<(T1, T2, T3, T4, T5)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, U> LiftFn<I, Splat<(T1, T2, T3, T4, T5)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, U> LiftFn<I, Splat<(T1, T2, T3, T4, T5, T6)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, U> LiftFn<I, Splat<(T1, T2, T3, T4, T5, T6)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, U> LiftFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, U> LiftFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8, U> LiftFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8, U> LiftFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>, U> for F
Source§impl<F, R, I, T1, T2, T3, U> MapFn<I, Splat<(T1, T2, T3)>, U> for F
impl<F, R, I, T1, T2, T3, U> MapFn<I, Splat<(T1, T2, T3)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, U> MapFn<I, Splat<(T1, T2, T3, T4)>, U> for F
impl<F, R, I, T1, T2, T3, T4, U> MapFn<I, Splat<(T1, T2, T3, T4)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, U> MapFn<I, Splat<(T1, T2, T3, T4, T5)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, U> MapFn<I, Splat<(T1, T2, T3, T4, T5)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, U> MapFn<I, Splat<(T1, T2, T3, T4, T5, T6)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, U> MapFn<I, Splat<(T1, T2, T3, T4, T5, T6)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, U> MapFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, U> MapFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>, U> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8, U> MapFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>, U> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8, U> MapFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>, U> for F
Source§impl<T: Ord> Ord for Splat<T>
impl<T: Ord> Ord for Splat<T>
Source§impl<T: PartialOrd> PartialOrd for Splat<T>
impl<T: PartialOrd> PartialOrd for Splat<T>
Source§impl<F, R, I, T1, T2, T3, S> SelectFn<I, Splat<(T1, T2, T3)>, S> for F
impl<F, R, I, T1, T2, T3, S> SelectFn<I, Splat<(T1, T2, T3)>, S> for F
Source§impl<F, R, I, T1, T2, T3, T4, S> SelectFn<I, Splat<(T1, T2, T3, T4)>, S> for F
impl<F, R, I, T1, T2, T3, T4, S> SelectFn<I, Splat<(T1, T2, T3, T4)>, S> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, S> SelectFn<I, Splat<(T1, T2, T3, T4, T5)>, S> for F
impl<F, R, I, T1, T2, T3, T4, T5, S> SelectFn<I, Splat<(T1, T2, T3, T4, T5)>, S> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, S> SelectFn<I, Splat<(T1, T2, T3, T4, T5, T6)>, S> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, S> SelectFn<I, Splat<(T1, T2, T3, T4, T5, T6)>, S> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, S> SelectFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>, S> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, S> SelectFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7)>, S> for F
Source§impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8, S> SelectFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>, S> for F
impl<F, R, I, T1, T2, T3, T4, T5, T6, T7, T8, S> SelectFn<I, Splat<(T1, T2, T3, T4, T5, T6, T7, T8)>, S> for F
impl<T: Eq> Eq for Splat<T>
impl<T> StructuralPartialEq for Splat<T>
Auto Trait Implementations§
impl<T> Freeze for Splat<T>where
T: Freeze,
impl<T> RefUnwindSafe for Splat<T>where
T: RefUnwindSafe,
impl<T> Send for Splat<T>where
T: Send,
impl<T> Sync for Splat<T>where
T: Sync,
impl<T> Unpin for Splat<T>where
T: Unpin,
impl<T> UnsafeUnpin for Splat<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Splat<T>where
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, E> IntoReport<T, E> for Twhere
E: Error,
impl<T, E> IntoReport<T, E> for Twhere
E: Error,
Source§fn into_report(self) -> Result<Report<T>, E>
fn into_report(self) -> Result<Report<T>, E>
Creates a report from a value T and wraps it in a result.
§Examples
use std::io::Error;
use zrx_diagnostic::report::IntoReport;
// Define function returning a value
fn f() -> impl IntoReport<i32, Error> {
42
}
// Invoke function and create report
let res = f().into_report();