pub enum Arg {
Null,
Bool(bool),
Num(f64),
Str(String),
List(Vec<Arg>),
Map(Obj),
Features(String),
Area {
r: String,
mask: String,
},
Lines {
r: String,
module: Option<String>,
},
Lazy(Lazy),
Func,
}Expand description
A value passed to or returned by the library.
Variants§
Null
Bool(bool)
Num(f64)
Str(String)
List(Vec<Arg>)
Map(Obj)
Features(String)
A set of map features (features.*).
Area
An area (areas.*, page.frame, a module’s .area). mask is what
compose.mask hides with: the area itself, or the module’s own.
Lines
Lines (lines.*, fills.fill, a module’s output). A module’s output
can be drawn, not transformed.
Lazy(Lazy)
A module’s part made only when it is asked for (graticule.keys,
labels.area, a label rule’s bucket): read it with Graph::get.
Func
A function, where the library takes none (it says so).
Implementations§
Source§impl Arg
impl Arg
pub fn str(s: &str) -> Arg
pub fn as_str(&self) -> Option<&str>
pub fn as_num(&self) -> Option<f64>
pub fn as_map(&self) -> Option<&Obj>
pub fn as_list(&self) -> Option<&[Arg]>
Sourcepub fn truthy(&self) -> bool
pub fn truthy(&self) -> bool
JavaScript’s truthiness, for the flags a script may write as anything.
Source§impl Arg
impl Arg
Sourcepub fn encode(&self) -> Value
pub fn encode(&self) -> Value
The value as JSON with its handles marked ({ "$area": "$areas.x", "mask": … }), for a binding to hand its own language and take back
with Arg::decode. A lazy part lists the parts it has.
Sourcepub fn decode(v: &Value) -> Arg
pub fn decode(v: &Value) -> Arg
A value from Arg::encode’s JSON: marked handles become handles.
Trait Implementations§
impl StructuralPartialEq for Arg
Auto Trait Implementations§
impl Forget for Arg
impl Freeze for Arg
impl Move for Arg
impl RefUnwindSafe for Arg
impl Send for Arg
impl Sync for Arg
impl Unpin for Arg
impl UnsafeUnpin for Arg
impl UnwindSafe for Arg
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more