pub struct Builder { /* private fields */ }Expand description
Builds an ListAppend instance.
Prefer Path::list_append over this.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn src<T>(self, src: T) -> Self
pub fn src<T>(self, src: T) -> Self
Sets the source Path to read the initial list from.
Defaults to the Path the combined list is being assigned to.
let list_append = "foo"
.parse::<Path>()?
.list_append()
.src("bar".parse::<Path>()?)
.list([1, 2, 3].map(Num::new));
assert_eq!("foo = list_append(bar, [1, 2, 3])", list_append.to_string());Compare with what happens without specifying a source Path:
let list_append = "foo"
.parse::<Path>()?
.list_append()
.list([1, 2, 3].map(Num::new));
assert_eq!("foo = list_append(foo, [1, 2, 3])", list_append.to_string());Sourcepub fn after(self) -> Self
pub fn after(self) -> Self
The new values will be appended to the end of the existing values.
This is the default.
let list_append = "foo".parse::<Path>()?.list_append().after().list([1, 2, 3].map(Num::new));
assert_eq!("foo = list_append(foo, [1, 2, 3])", list_append.to_string());Compare with when before is used:
let list_append = "foo".parse::<Path>()?.list_append().before().list([1, 2, 3].map(Num::new));
assert_eq!("foo = list_append([1, 2, 3], foo)", list_append.to_string());The default, with the same behavior as after:
let list_append = "foo".parse::<Path>()?.list_append().list([1, 2, 3].map(Num::new));
assert_eq!("foo = list_append(foo, [1, 2, 3])", list_append.to_string());Sourcepub fn before(self) -> Self
pub fn before(self) -> Self
The new values will be placed before the existing values.
Defaults to appending new values after existing values.
let list_append = "foo".parse::<Path>()?.list_append().before().list([1, 2, 3].map(Num::new));
assert_eq!("foo = list_append([1, 2, 3], foo)", list_append.to_string());Compare with when after is used:
let list_append = "foo".parse::<Path>()?.list_append().after().list([1, 2, 3].map(Num::new));
assert_eq!("foo = list_append(foo, [1, 2, 3])", list_append.to_string());The default, with the same behavior as after:
let list_append = "foo".parse::<Path>()?.list_append().list([1, 2, 3].map(Num::new));
assert_eq!("foo = list_append(foo, [1, 2, 3])", list_append.to_string());Sourcepub fn list<T>(self, list: T) -> ListAppend
pub fn list<T>(self, list: T) -> ListAppend
Sets the new value(s) to concatenate with the specified field.
Consumes this Builder and creates a ListAppend instance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.