[−][src]Struct tremor_script::query::StmtRental
rental around Stmt
Methods
impl Stmt
[src]
pub fn new<__Fstmt>(query: Arc<Query>, stmt: __Fstmt) -> Self where
__Fstmt: for<'query> FnOnce(&'query Query) -> Stmt<'query>,
[src]
__Fstmt: for<'query> FnOnce(&'query Query) -> Stmt<'query>,
Create a new instance of the rental struct.
The first argument provided is the head, followed by a series of closures, one for each tail field. Each of these closures will receive, as its arguments, a borrow of the previous field, followed by borrows of the remaining prefix fields if the struct is a shared rental. If the struct is a mutable rental, only the immediately preceding field is passed.
pub fn try_new<__Fstmt, __E>(
query: Arc<Query>,
stmt: __Fstmt
) -> RentalResult<Self, __E, Arc<Query>> where
__Fstmt: for<'query> FnOnce(&'query Query) -> Result<Stmt<'query>, __E>,
[src]
query: Arc<Query>,
stmt: __Fstmt
) -> RentalResult<Self, __E, Arc<Query>> where
__Fstmt: for<'query> FnOnce(&'query Query) -> Result<Stmt<'query>, __E>,
Attempt to create a new instance of the rental struct.
As new
, but each closure returns a Result
. If one of them fails, execution is short-circuited and a tuple of the error and the original head value is returned to you.
pub fn try_new_or_drop<__Fstmt, __E>(
query: Arc<Query>,
stmt: __Fstmt
) -> Result<Self, __E> where
__Fstmt: for<'query> FnOnce(&'query Query) -> Result<Stmt<'query>, __E>,
[src]
query: Arc<Query>,
stmt: __Fstmt
) -> Result<Self, __E> where
__Fstmt: for<'query> FnOnce(&'query Query) -> Result<Stmt<'query>, __E>,
Attempt to create a new instance of the rental struct.
As try_new
, but only the error value is returned upon failure; the head value is dropped. This method interacts more smoothly with existing error conversions.
pub unsafe fn all_erased(&self) -> Self::Borrow
[src]
Return lifetime-erased shared borrows of the fields of the struct.
This is unsafe because the erased lifetimes are fake. Use this only if absolutely necessary and be very mindful of what the true lifetimes are.
pub unsafe fn all_mut_erased(&mut self) -> Self::BorrowMut
[src]
Return a lifetime-erased mutable borrow of the suffix of the struct.
This is unsafe because the erased lifetimes are fake. Use this only if absolutely necessary and be very mindful of what the true lifetimes are.
pub fn rent<__F, __R>(&self, f: __F) -> __R where
__F: for<'stmt, 'query> FnOnce(&'stmt Stmt<'query>) -> __R,
__R: ,
[src]
__F: for<'stmt, 'query> FnOnce(&'stmt Stmt<'query>) -> __R,
__R: ,
Execute a closure on the shared suffix of the struct.
The closure may return any value not bounded by one of the special rental lifetimes of the struct.
pub fn rent_mut<__F, __R>(&mut self, f: __F) -> __R where
__F: for<'stmt, 'query> FnOnce(&'stmt mut Stmt<'query>) -> __R,
__R: ,
[src]
__F: for<'stmt, 'query> FnOnce(&'stmt mut Stmt<'query>) -> __R,
__R: ,
Execute a closure on the mutable suffix of the struct.
The closure may return any value not bounded by one of the special rental lifetimes of the struct.
pub fn ref_rent<__F, __R>(&self, f: __F) -> &__R where
__F: for<'stmt, 'query> FnOnce(&'stmt Stmt<'query>) -> &'stmt __R,
__R: ?Sized,
[src]
__F: for<'stmt, 'query> FnOnce(&'stmt Stmt<'query>) -> &'stmt __R,
__R: ?Sized,
Return a shared reference from the shared suffix of the struct.
This is a subtle variation of rent
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn maybe_ref_rent<__F, __R>(&self, f: __F) -> Option<&__R> where
__F: for<'stmt, 'query> FnOnce(&'stmt Stmt<'query>) -> Option<&'stmt __R>,
__R: ?Sized,
[src]
__F: for<'stmt, 'query> FnOnce(&'stmt Stmt<'query>) -> Option<&'stmt __R>,
__R: ?Sized,
Optionally return a shared reference from the shared suffix of the struct.
This is a subtle variation of rent
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn try_ref_rent<__F, __R, __E>(&self, f: __F) -> Result<&__R, __E> where
__F: for<'stmt, 'query> FnOnce(&'stmt Stmt<'query>) -> Result<&'stmt __R, __E>,
__R: ?Sized,
[src]
__F: for<'stmt, 'query> FnOnce(&'stmt Stmt<'query>) -> Result<&'stmt __R, __E>,
__R: ?Sized,
Try to return a shared reference from the shared suffix of the struct, or an error on failure.
This is a subtle variation of rent
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn ref_rent_mut<__F, __R>(&mut self, f: __F) -> &mut __R where
__F: for<'stmt, 'query> FnOnce(&'stmt mut Stmt<'query>) -> &'stmt mut __R,
__R: ?Sized,
[src]
__F: for<'stmt, 'query> FnOnce(&'stmt mut Stmt<'query>) -> &'stmt mut __R,
__R: ?Sized,
Return a mutable reference from the mutable suffix of the struct.
This is a subtle variation of rent_mut
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn maybe_ref_rent_mut<__F, __R>(&mut self, f: __F) -> Option<&mut __R> where
__F: for<'stmt, 'query> FnOnce(&'stmt mut Stmt<'query>) -> Option<&'stmt mut __R>,
__R: ?Sized,
[src]
__F: for<'stmt, 'query> FnOnce(&'stmt mut Stmt<'query>) -> Option<&'stmt mut __R>,
__R: ?Sized,
Optionally return a mutable reference from the mutable suffix of the struct.
This is a subtle variation of rent_mut
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn try_ref_rent_mut<__F, __R, __E>(
&mut self,
f: __F
) -> Result<&mut __R, __E> where
__F: for<'stmt, 'query> FnOnce(&'stmt mut Stmt<'query>) -> Result<&'stmt mut __R, __E>,
__R: ?Sized,
[src]
&mut self,
f: __F
) -> Result<&mut __R, __E> where
__F: for<'stmt, 'query> FnOnce(&'stmt mut Stmt<'query>) -> Result<&'stmt mut __R, __E>,
__R: ?Sized,
Try to return a mutable reference from the mutable suffix of the struct, or an error on failure.
This is a subtle variation of rent_mut
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn into_head(self) -> Arc<Query>
[src]
Drop the rental struct and return the original head value to you.
impl Stmt
[src]
pub fn head(&self) -> &<Arc<Query> as Deref>::Target
[src]
Return a shared reference to the head field of the struct.
pub fn rent_all<__F, __R>(&self, f: __F) -> __R where
__F: for<'query, 'stmt> FnOnce(Stmt_Borrow<'query, 'stmt>) -> __R,
__R: ,
[src]
__F: for<'query, 'stmt> FnOnce(Stmt_Borrow<'query, 'stmt>) -> __R,
__R: ,
Execute a closure on shared borrows of the fields of the struct.
The closure may return any value not bounded by one of the special rental lifetimes of the struct.
pub fn ref_rent_all<__F, __R>(&self, f: __F) -> &__R where
__F: for<'query, 'stmt> FnOnce(Stmt_Borrow<'query, 'stmt>) -> &'stmt __R,
__R: ?Sized,
[src]
__F: for<'query, 'stmt> FnOnce(Stmt_Borrow<'query, 'stmt>) -> &'stmt __R,
__R: ?Sized,
Return a shared reference from shared borrows of the fields of the struct.
This is a subtle variation of rent_all
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn maybe_ref_rent_all<__F, __R>(&self, f: __F) -> Option<&__R> where
__F: for<'query, 'stmt> FnOnce(Stmt_Borrow<'query, 'stmt>) -> Option<&'stmt __R>,
__R: ?Sized,
[src]
__F: for<'query, 'stmt> FnOnce(Stmt_Borrow<'query, 'stmt>) -> Option<&'stmt __R>,
__R: ?Sized,
Optionally return a shared reference from shared borrows of the fields of the struct.
This is a subtle variation of rent_all
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn try_ref_rent_all<__F, __R, __E>(&self, f: __F) -> Result<&__R, __E> where
__F: for<'query, 'stmt> FnOnce(Stmt_Borrow<'query, 'stmt>) -> Result<&'stmt __R, __E>,
__R: ?Sized,
[src]
__F: for<'query, 'stmt> FnOnce(Stmt_Borrow<'query, 'stmt>) -> Result<&'stmt __R, __E>,
__R: ?Sized,
Try to return a shared reference from shared borrows of the fields of the struct, or an error on failure.
This is a subtle variation of rent_all
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn rent_all_mut<__F, __R>(&mut self, f: __F) -> __R where
__F: for<'query, 'stmt> FnOnce(Stmt_BorrowMut<'query, 'stmt>) -> __R,
__R: ,
[src]
__F: for<'query, 'stmt> FnOnce(Stmt_BorrowMut<'query, 'stmt>) -> __R,
__R: ,
Execute a closure on shared borrows of the prefix fields and a mutable borrow of the suffix field of the struct.
The closure may return any value not bounded by one of the special rental lifetimes of the struct.
pub fn ref_rent_all_mut<__F, __R>(&mut self, f: __F) -> &mut __R where
__F: for<'query, 'stmt> FnOnce(Stmt_BorrowMut<'query, 'stmt>) -> &'stmt mut __R,
__R: ?Sized,
[src]
__F: for<'query, 'stmt> FnOnce(Stmt_BorrowMut<'query, 'stmt>) -> &'stmt mut __R,
__R: ?Sized,
Return a mutable reference from shared borrows of the prefix fields and a mutable borrow of the suffix field of the struct.
This is a subtle variation of rent_all_mut
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn maybe_ref_rent_all_mut<__F, __R>(&mut self, f: __F) -> Option<&mut __R> where
__F: for<'query, 'stmt> FnOnce(Stmt_BorrowMut<'query, 'stmt>) -> Option<&'stmt mut __R>,
__R: ?Sized,
[src]
__F: for<'query, 'stmt> FnOnce(Stmt_BorrowMut<'query, 'stmt>) -> Option<&'stmt mut __R>,
__R: ?Sized,
Optionally return a mutable reference from shared borrows of the prefix fields and a mutable borrow of the suffix field of the struct.
This is a subtle variation of rent_all_mut
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
pub fn try_ref_rent_all_mut<__F, __R, __E>(
&mut self,
f: __F
) -> Result<&mut __R, __E> where
__F: for<'query, 'stmt> FnOnce(Stmt_BorrowMut<'query, 'stmt>) -> Result<&'stmt mut __R, __E>,
__R: ?Sized,
[src]
&mut self,
f: __F
) -> Result<&mut __R, __E> where
__F: for<'query, 'stmt> FnOnce(Stmt_BorrowMut<'query, 'stmt>) -> Result<&'stmt mut __R, __E>,
__R: ?Sized,
Try to return a mutable reference from shared borrows of the prefix fields and a mutable borrow of the suffix field of the struct, or an error on failure.
This is a subtle variation of rent_all_mut
where it is legal to return a reference bounded by a rental lifetime, because that lifetime is reborrowed away before it is returned to you.
impl Stmt
[src]
pub fn all<'__s>(&'__s self) -> Self::Borrow
[src]
Borrow all fields of the struct by reborrowing away the rental lifetimes.
This is safe because the lifetimes are verified to be covariant first.
pub fn suffix(&self) -> <Self::Borrow as IntoSuffix>::Suffix
[src]
Borrow the suffix field of the struct by reborrowing away the rental lifetimes.
This is safe because the lifetimes are verified to be covariant first.
Trait Implementations
impl Debug for Stmt where
Arc<Query>: Debug,
Stmt<'static>: Debug,
[src]
Arc<Query>: Debug,
Stmt<'static>: Debug,
impl Eq for Stmt
[src]
impl PartialEq<Stmt> for Stmt
[src]
impl PartialOrd<Stmt> for Stmt
[src]
fn partial_cmp(&self, _other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'query: 'stmt, 'stmt> Rental2<'query, 'stmt> for Stmt
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl !UnwindSafe for Stmt
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,