[][src]Struct tremor_script::LineValue

pub struct LineValue { /* fields omitted */ }

Rental wrapped value with the data it was parsed from from

Methods

impl Value[src]

pub fn new<__Fparsed>(raw: Vec<Vec<u8>>, parsed: __Fparsed) -> Self where
    __Fparsed: for<'raw> FnOnce(&'raw mut [Vec<u8>]) -> ValueAndMeta<'raw>, 
[src]

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<__Fparsed, __E>(
    raw: Vec<Vec<u8>>,
    parsed: __Fparsed
) -> RentalResult<Self, __E, Vec<Vec<u8>>> where
    __Fparsed: for<'raw> FnOnce(&'raw mut [Vec<u8>]) -> Result<ValueAndMeta<'raw>, __E>, 
[src]

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<__Fparsed, __E>(
    raw: Vec<Vec<u8>>,
    parsed: __Fparsed
) -> Result<Self, __E> where
    __Fparsed: for<'raw> FnOnce(&'raw mut [Vec<u8>]) -> Result<ValueAndMeta<'raw>, __E>, 
[src]

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<'parsed, 'raw> FnOnce(&'parsed ValueAndMeta<'raw>) -> __R,
    __R: , 
[src]

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<'parsed, 'raw> FnOnce(&'parsed mut ValueAndMeta<'raw>) -> __R,
    __R: , 
[src]

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<'parsed, 'raw> FnOnce(&'parsed ValueAndMeta<'raw>) -> &'parsed __R,
    __R: ?Sized
[src]

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<'parsed, 'raw> FnOnce(&'parsed ValueAndMeta<'raw>) -> Option<&'parsed __R>,
    __R: ?Sized
[src]

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<'parsed, 'raw> FnOnce(&'parsed ValueAndMeta<'raw>) -> Result<&'parsed __R, __E>,
    __R: ?Sized
[src]

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<'parsed, 'raw> FnOnce(&'parsed mut ValueAndMeta<'raw>) -> &'parsed mut __R,
    __R: ?Sized
[src]

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<'parsed, 'raw> FnOnce(&'parsed mut ValueAndMeta<'raw>) -> Option<&'parsed mut __R>,
    __R: ?Sized
[src]

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<'parsed, 'raw> FnOnce(&'parsed mut ValueAndMeta<'raw>) -> Result<&'parsed mut __R, __E>,
    __R: ?Sized
[src]

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) -> Vec<Vec<u8>>[src]

Drop the rental struct and return the original head value to you.

impl Value[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.

impl Value[src]

pub fn parts<'value, 'borrow>(
    &'borrow self
) -> (&'borrow mut Value<'value>, &'borrow mut Value<'value>) where
    'borrow: 'value, 
[src]

Borrow the parts (event and metadata) from a rental. This borrows the data as immutable and then transmutes it to be mutable.

pub fn consume<'run, E, F>(
    &'run mut self,
    other: Self,
    join_f: F
) -> Result<(), E> where
    E: Error,
    F: Fn(&mut ValueAndMeta<'static>, ValueAndMeta<'static>) -> Result<(), E>, 
[src]

Consumes an event into another This function works around a rental limitation that is meant to protect its users: Rental does not allow you to get both the owned and borrowed part at the same time.

The reason for that is that once those are taken out of the rental the link of lifetimes between them would be broken and you'd risk invalid pointers or memory leaks. We however do not really want to take them out, all we want is combine two rentals. We can do this since:

  1. the owned values are inside a vector, while the vector itself may be relocated by adding to it, the values in it will stay in the same location.
  2. we are only ever adding / extending never deleting or modifying.

So what this function does it is crowbars the content from a rental into an accessible struct then uses this to modify its content by adding the owned parts of other into the owned part self and the running a merge function on the borrowed parts

Trait Implementations

impl Clone for LineValue[src]

impl Debug for Value where
    ValueAndMeta<'static>: Debug
[src]

impl<'de> Deserialize<'de> for LineValue[src]

impl From<(Value<'static>, HashMap<Cow<'static, str>, Value<'static>, BuildHasherDefault<FxHasher>>)> for Value[src]

impl From<(Value<'static>, Value<'static>)> for Value[src]

impl From<Value<'static>> for Value[src]

impl PartialEq<Value> for LineValue[src]

impl<'raw: 'parsed, 'parsed> Rental2<'raw, 'parsed> for Value[src]

type Borrow = Value_Borrow<'raw, 'parsed>

type BorrowMut = Value_BorrowMut<'raw, 'parsed>

impl Serialize for LineValue[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,