Skip to main content

ExprKind

Enum ExprKind 

Source
pub enum ExprKind {
    Pointer(Sid),
    Literal(Vec<u8>),
    Call(Box<Call>),
    Function(Box<Function>),
    Tuple(Box<Tuple>),
    Array(Box<Array>),
    EnumVariant(Box<EnumVariant>),
    EnumEq(Box<EnumEq>),
    Offset(Box<Offset>),
    Deref(Box<Deref>),
    Binding(Box<Binding>),
    Switch(Vec<SwitchBranch>),
}

Variants§

§

Pointer(Sid)

§

Literal(Vec<u8>)

§

Call(Box<Call>)

§

Function(Box<Function>)

§

Tuple(Box<Tuple>)

§

Array(Box<Array>)

§

EnumVariant(Box<EnumVariant>)

§

EnumEq(Box<EnumEq>)

§

Offset(Box<Offset>)

§

Deref(Box<Deref>)

§

Binding(Box<Binding>)

§

Switch(Vec<SwitchBranch>)

Implementations§

Source§

impl ExprKind

Source

pub fn is_pointer(&self) -> bool

Returns true if this is a ExprKind::Pointer, otherwise false

Source

pub fn as_pointer_mut(&mut self) -> Option<&mut Sid>

Optionally returns mutable references to the inner fields if this is a ExprKind::Pointer, otherwise None

Source

pub fn as_pointer(&self) -> Option<&Sid>

Optionally returns references to the inner fields if this is a ExprKind::Pointer, otherwise None

Source

pub fn into_pointer(self) -> Result<Sid, Self>

Returns the inner fields if this is a ExprKind::Pointer, otherwise returns back the enum in the Err case of the result

Source

pub fn is_literal(&self) -> bool

Returns true if this is a ExprKind::Literal, otherwise false

Source

pub fn as_literal_mut(&mut self) -> Option<&mut Vec<u8>>

Optionally returns mutable references to the inner fields if this is a ExprKind::Literal, otherwise None

Source

pub fn as_literal(&self) -> Option<&Vec<u8>>

Optionally returns references to the inner fields if this is a ExprKind::Literal, otherwise None

Source

pub fn into_literal(self) -> Result<Vec<u8>, Self>

Returns the inner fields if this is a ExprKind::Literal, otherwise returns back the enum in the Err case of the result

Source

pub fn is_call(&self) -> bool

Returns true if this is a ExprKind::Call, otherwise false

Source

pub fn as_call_mut(&mut self) -> Option<&mut Box<Call>>

Optionally returns mutable references to the inner fields if this is a ExprKind::Call, otherwise None

Source

pub fn as_call(&self) -> Option<&Box<Call>>

Optionally returns references to the inner fields if this is a ExprKind::Call, otherwise None

Source

pub fn into_call(self) -> Result<Box<Call>, Self>

Returns the inner fields if this is a ExprKind::Call, otherwise returns back the enum in the Err case of the result

Source

pub fn is_function(&self) -> bool

Returns true if this is a ExprKind::Function, otherwise false

Source

pub fn as_function_mut(&mut self) -> Option<&mut Box<Function>>

Optionally returns mutable references to the inner fields if this is a ExprKind::Function, otherwise None

Source

pub fn as_function(&self) -> Option<&Box<Function>>

Optionally returns references to the inner fields if this is a ExprKind::Function, otherwise None

Source

pub fn into_function(self) -> Result<Box<Function>, Self>

Returns the inner fields if this is a ExprKind::Function, otherwise returns back the enum in the Err case of the result

Source

pub fn is_tuple(&self) -> bool

Returns true if this is a ExprKind::Tuple, otherwise false

Source

pub fn as_tuple_mut(&mut self) -> Option<&mut Box<Tuple>>

Optionally returns mutable references to the inner fields if this is a ExprKind::Tuple, otherwise None

Source

pub fn as_tuple(&self) -> Option<&Box<Tuple>>

Optionally returns references to the inner fields if this is a ExprKind::Tuple, otherwise None

Source

pub fn into_tuple(self) -> Result<Box<Tuple>, Self>

Returns the inner fields if this is a ExprKind::Tuple, otherwise returns back the enum in the Err case of the result

Source

pub fn is_array(&self) -> bool

Returns true if this is a ExprKind::Array, otherwise false

Source

pub fn as_array_mut(&mut self) -> Option<&mut Box<Array>>

Optionally returns mutable references to the inner fields if this is a ExprKind::Array, otherwise None

Source

pub fn as_array(&self) -> Option<&Box<Array>>

Optionally returns references to the inner fields if this is a ExprKind::Array, otherwise None

Source

pub fn into_array(self) -> Result<Box<Array>, Self>

Returns the inner fields if this is a ExprKind::Array, otherwise returns back the enum in the Err case of the result

Source

pub fn is_enum_variant(&self) -> bool

Returns true if this is a ExprKind::EnumVariant, otherwise false

Source

pub fn as_enum_variant_mut(&mut self) -> Option<&mut Box<EnumVariant>>

Optionally returns mutable references to the inner fields if this is a ExprKind::EnumVariant, otherwise None

Source

pub fn as_enum_variant(&self) -> Option<&Box<EnumVariant>>

Optionally returns references to the inner fields if this is a ExprKind::EnumVariant, otherwise None

Source

pub fn into_enum_variant(self) -> Result<Box<EnumVariant>, Self>

Returns the inner fields if this is a ExprKind::EnumVariant, otherwise returns back the enum in the Err case of the result

Source

pub fn is_enum_eq(&self) -> bool

Returns true if this is a ExprKind::EnumEq, otherwise false

Source

pub fn as_enum_eq_mut(&mut self) -> Option<&mut Box<EnumEq>>

Optionally returns mutable references to the inner fields if this is a ExprKind::EnumEq, otherwise None

Source

pub fn as_enum_eq(&self) -> Option<&Box<EnumEq>>

Optionally returns references to the inner fields if this is a ExprKind::EnumEq, otherwise None

Source

pub fn into_enum_eq(self) -> Result<Box<EnumEq>, Self>

Returns the inner fields if this is a ExprKind::EnumEq, otherwise returns back the enum in the Err case of the result

Source

pub fn is_offset(&self) -> bool

Returns true if this is a ExprKind::Offset, otherwise false

Source

pub fn as_offset_mut(&mut self) -> Option<&mut Box<Offset>>

Optionally returns mutable references to the inner fields if this is a ExprKind::Offset, otherwise None

Source

pub fn as_offset(&self) -> Option<&Box<Offset>>

Optionally returns references to the inner fields if this is a ExprKind::Offset, otherwise None

Source

pub fn into_offset(self) -> Result<Box<Offset>, Self>

Returns the inner fields if this is a ExprKind::Offset, otherwise returns back the enum in the Err case of the result

Source

pub fn is_deref(&self) -> bool

Returns true if this is a ExprKind::Deref, otherwise false

Source

pub fn as_deref_mut(&mut self) -> Option<&mut Box<Deref>>

Optionally returns mutable references to the inner fields if this is a ExprKind::Deref, otherwise None

Source

pub fn as_deref(&self) -> Option<&Box<Deref>>

Optionally returns references to the inner fields if this is a ExprKind::Deref, otherwise None

Source

pub fn into_deref(self) -> Result<Box<Deref>, Self>

Returns the inner fields if this is a ExprKind::Deref, otherwise returns back the enum in the Err case of the result

Source

pub fn is_binding(&self) -> bool

Returns true if this is a ExprKind::Binding, otherwise false

Source

pub fn as_binding_mut(&mut self) -> Option<&mut Box<Binding>>

Optionally returns mutable references to the inner fields if this is a ExprKind::Binding, otherwise None

Source

pub fn as_binding(&self) -> Option<&Box<Binding>>

Optionally returns references to the inner fields if this is a ExprKind::Binding, otherwise None

Source

pub fn into_binding(self) -> Result<Box<Binding>, Self>

Returns the inner fields if this is a ExprKind::Binding, otherwise returns back the enum in the Err case of the result

Source

pub fn is_switch(&self) -> bool

Returns true if this is a ExprKind::Switch, otherwise false

Source

pub fn as_switch_mut(&mut self) -> Option<&mut Vec<SwitchBranch>>

Optionally returns mutable references to the inner fields if this is a ExprKind::Switch, otherwise None

Source

pub fn as_switch(&self) -> Option<&Vec<SwitchBranch>>

Optionally returns references to the inner fields if this is a ExprKind::Switch, otherwise None

Source

pub fn into_switch(self) -> Result<Vec<SwitchBranch>, Self>

Returns the inner fields if this is a ExprKind::Switch, otherwise returns back the enum in the Err case of the result

Trait Implementations§

Source§

impl Clone for ExprKind

Source§

fn clone(&self) -> ExprKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExprKind

Source§

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

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

impl Decode for ExprKind

Source§

fn decode(buf: &[u8]) -> Result<Self>

Source§

impl Encode for ExprKind

Source§

type HeadPtr = ExprKindHeadPtr

Source§

fn encode_head(&self, w: &mut BytesMut) -> ExprKindHeadPtr

Source§

fn encode_body(&self, head: ExprKindHeadPtr, w: &mut BytesMut)

Source§

fn encode(&self) -> Vec<u8>

Source§

impl Layout for ExprKind

Source§

fn head_size() -> usize

Returns the size of the head in bits for a given type.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.