Struct starlark::eval::ParametersParser
source · pub struct ParametersParser<'v, 'a>(/* private fields */);
Expand description
Parse a series of parameters which were specified by ParametersSpec
.
This is usually created with ParametersSpec::parser
.
Implementations§
source§impl<'v, 'a> ParametersParser<'v, 'a>
impl<'v, 'a> ParametersParser<'v, 'a>
sourcepub fn new(slots: &'a [Cell<Option<Value<'v>>>]) -> Self
pub fn new(slots: &'a [Cell<Option<Value<'v>>>]) -> Self
Create a parameter parser, which stored parameters into provided slots reference.
sourcepub fn next_opt<T: UnpackValue<'v>>(&mut self, name: &str) -> Result<Option<T>>
pub fn next_opt<T: UnpackValue<'v>>(&mut self, name: &str) -> Result<Option<T>>
Obtain the next parameter, corresponding to ParametersSpecBuilder::optional
.
It is an error to request more parameters than were specified.
The name
is only used for error messages.
sourcepub fn next<T: UnpackValue<'v>>(&mut self, name: &str) -> Result<T>
pub fn next<T: UnpackValue<'v>>(&mut self, name: &str) -> Result<T>
Obtain the next parameter, which can’t be defined by ParametersSpecBuilder::optional
.
It is an error to request more parameters than were specified.
The name
is only used for error messages.
Auto Trait Implementations§
impl<'v, 'a> !RefUnwindSafe for ParametersParser<'v, 'a>
impl<'v, 'a> !Send for ParametersParser<'v, 'a>
impl<'v, 'a> !Sync for ParametersParser<'v, 'a>
impl<'v, 'a> Unpin for ParametersParser<'v, 'a>
impl<'v, 'a> !UnwindSafe for ParametersParser<'v, 'a>
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