pub enum ExprShape {
Call {
callee: CalleeShape,
argc: usize,
},
MethodCall {
method: String,
argc: usize,
},
Path,
Lit,
Other,
}Expand description
A normalized expression shape used by paragraph statements.
Variants§
Call
A function call with known or unknown callee identity and arity.
MethodCall
A method call with method name and arity.
Path
A stable path expression.
Lit
A stable literal expression.
Other
A present expression shape outside the supported model.
Implementations§
Source§impl ExprShape
impl ExprShape
Sourcepub const fn call(callee: CalleeShape, argc: usize) -> Self
pub const fn call(callee: CalleeShape, argc: usize) -> Self
Builds a function-call expression shape.
§Examples
use whitaker_common::rstest::{CalleeShape, ExprShape};
let shape = ExprShape::call(CalleeShape::def_path("crate::make_user"), 2);
assert_eq!(
shape,
ExprShape::Call {
callee: CalleeShape::def_path("crate::make_user"),
argc: 2,
},
);Sourcepub fn method_call(method: impl Into<String>, argc: usize) -> Self
pub fn method_call(method: impl Into<String>, argc: usize) -> Self
Builds a method-call expression shape.
Trait Implementations§
impl Eq for ExprShape
impl StructuralPartialEq for ExprShape
Auto Trait Implementations§
impl Freeze for ExprShape
impl RefUnwindSafe for ExprShape
impl Send for ExprShape
impl Sync for ExprShape
impl Unpin for ExprShape
impl UnsafeUnpin for ExprShape
impl UnwindSafe for ExprShape
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