pub struct ArgsResolverBuilder { /* private fields */ }Expand description
Staged builder for ArgsResolver. Call .for_target(id) to scope
subsequent .map() calls to that target.
Implementations§
Source§impl ArgsResolverBuilder
impl ArgsResolverBuilder
Sourcepub fn for_target(self, target: impl Into<ObjectId>) -> Self
pub fn for_target(self, target: impl Into<ObjectId>) -> Self
Set the target for subsequent .map() calls. Re-calling with a
different id switches scope; calling with the same id is a no-op.
Sourcepub fn map(self, arg_field: impl Into<String>, label: impl Into<String>) -> Self
pub fn map(self, arg_field: impl Into<String>, label: impl Into<String>) -> Self
Map a JSON arg field to a designation label, scoped to the current
target set by the most recent .for_target() call.
§Panics
Panics if called before .for_target(). The current target is
programmer-set state, so a missing target is a programming error
rather than a runtime condition.
Sourcepub fn build(self) -> ArgsResolver
pub fn build(self) -> ArgsResolver
Finalize the builder.
Trait Implementations§
Source§impl Debug for ArgsResolverBuilder
impl Debug for ArgsResolverBuilder
Source§impl Default for ArgsResolverBuilder
impl Default for ArgsResolverBuilder
Source§fn default() -> ArgsResolverBuilder
fn default() -> ArgsResolverBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ArgsResolverBuilder
impl RefUnwindSafe for ArgsResolverBuilder
impl Send for ArgsResolverBuilder
impl Sync for ArgsResolverBuilder
impl Unpin for ArgsResolverBuilder
impl UnsafeUnpin for ArgsResolverBuilder
impl UnwindSafe for ArgsResolverBuilder
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