Skip to main content

yog_script_analyze/ast/
pass.rs

1//! How a value is handed to a method (`ys.md` ยง3, Ownership): C#'s `in`,
2//! `ref` and `out`, and Rust's moves. Written at both ends โ€” the parameter
3//! and the argument โ€” so a reader of either sees it.
4
5/// A parameter's or an argument's way of passing.
6#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub enum Pass {
8    /// `in`: lent to read (Rust's `&T`).
9    In,
10    /// `ref`: lent to change; the caller's must be `let mut` (`&mut T`).
11    Ref,
12    /// `out`: the method gives it (`out let x` at the call).
13    Out,
14    /// `move`: owned from then on; the caller's is gone after.
15    Move,
16}