#[non_exhaustive]pub enum Join {
Fold(NameRef),
Call(NameRef),
Template(TemplateId),
}Expand description
How the pieces of an interpolated string become one string.
§Examples
use lower_lang::{Join, MappingBuilder};
let mut b = MappingBuilder::<u8>::new();
let concat = b.name("mox.concat");
// "a{$x}b" → mox.concat(mox.concat("a", x), "b")
let fold = Join::Fold(concat);
assert_ne!(fold, Join::Call(concat));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Fold(NameRef)
A host function of two arguments, folded left:
concat(concat(p0, p1), p2) (PHP’s .).
Call(NameRef)
One call of a host function with every piece as an argument:
interp(p0, p1, p2) (one LSB call, no intermediate strings).
Template(TemplateId)
A template: with exactly two expression holes it is folded left like
Fold; with exactly one argument-list hole it receives every piece at
once. Any other hole shape is refused by
build
(MappingError::BadJoin).
Trait Implementations§
impl Copy for Join
impl Eq for Join
impl StructuralPartialEq for Join
Auto Trait Implementations§
impl Freeze for Join
impl RefUnwindSafe for Join
impl Send for Join
impl Sync for Join
impl Unpin for Join
impl UnsafeUnpin for Join
impl UnwindSafe for Join
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