pub enum LambdaParameter {
Single((Box<str>, OnionObject)),
Multiple(Box<[LambdaParameter]>),
}Variants§
Single((Box<str>, OnionObject))
Multiple(Box<[LambdaParameter]>)
Implementations§
Source§impl LambdaParameter
impl LambdaParameter
pub fn len(&self) -> usize
Sourcepub fn constraint_at(&self, index: usize) -> Option<&OnionObject>
pub fn constraint_at(&self, index: usize) -> Option<&OnionObject>
按照扁平化的方式依照顺序获取参数的约束定义
pub fn key_at(&self, index: usize) -> Option<&str>
pub fn at(&self, index: usize) -> Option<(&str, &OnionObject)>
Sourcepub fn to_onion(&self) -> OnionStaticObject
pub fn to_onion(&self) -> OnionStaticObject
打包成一个对象
pub fn from_onion(obj: &OnionObject) -> Result<LambdaParameter, RuntimeError>
Source§impl LambdaParameter
impl LambdaParameter
pub fn upgrade(&self, collected: &mut Vec<GCArc<OnionObjectCell>>)
Source§impl LambdaParameter
impl LambdaParameter
pub fn unpack_arguments( &self, argument: &OnionObject, ) -> Result<Vec<OnionObject>, RuntimeError>
Source§impl LambdaParameter
impl LambdaParameter
Sourcepub fn flatten_keys(&self) -> Box<[Box<str>]>
pub fn flatten_keys(&self) -> Box<[Box<str>]>
Recursively flattens the parameter structure to produce a flat list of parameter names.
For a parameter structure like (a, (b, c)), this will return ["a", "b", "c"].
Sourcepub fn flatten_constraints(&self) -> Box<[OnionObject]>
pub fn flatten_constraints(&self) -> Box<[OnionObject]>
Recursively flattens the parameter structure to produce a flat list of constraint objects.
For a parameter structure like (a: Int, (b: String, c: Bool)),
this will return a Vec containing the OnionObject for Int, String, and Bool.
Trait Implementations§
Source§impl Clone for LambdaParameter
impl Clone for LambdaParameter
Source§fn clone(&self) -> LambdaParameter
fn clone(&self) -> LambdaParameter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LambdaParameter
impl Debug for LambdaParameter
Source§impl Display for LambdaParameter
impl Display for LambdaParameter
Source§impl GCTraceable<OnionObjectCell> for LambdaParameter
impl GCTraceable<OnionObjectCell> for LambdaParameter
Auto Trait Implementations§
impl Freeze for LambdaParameter
impl !RefUnwindSafe for LambdaParameter
impl Send for LambdaParameter
impl Sync for LambdaParameter
impl Unpin for LambdaParameter
impl !UnwindSafe for LambdaParameter
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
Mutably borrows from an owned value. Read more