pub struct Closure { /* private fields */ }Expand description
Builder struct.
Implementations§
Source§impl Closure
impl Closure
pub fn new<N: AsRef<str>, F: AsRef<str>>( name: N, supported_format: F, parser: BoxedParserFn, ) -> Self
pub fn set_parser(&mut self, parser: BoxedParserFn)
pub fn with_parser(self, parser: BoxedParserFn) -> Self
pub fn set_validator(&mut self, validator: BoxedValidatorFn)
pub fn with_validator(self, validator: BoxedValidatorFn) -> Self
pub fn set_format_list<N: AsRef<str>>(&mut self, format_list: &[N])
pub fn with_format_list<N: AsRef<str>>(self, format_list: &[N]) -> Self
Trait Implementations§
Source§impl Parser for Closure
impl Parser for Closure
Source§fn supported_format_list(&self) -> Vec<String>
fn supported_format_list(&self) -> Vec<String>
Supported format list (e.g. “yml”)
Source§fn is_format_supported(&self, bytes: &[u8]) -> Option<bool>
fn is_format_supported(&self, bytes: &[u8]) -> Option<bool>
Checks if provided byte slice is ok for future parsing. (e.g. is it YAML at all or not)
fn parse(&self, bytes: &[u8]) -> Result<Input, Error>
Auto Trait Implementations§
impl Freeze for Closure
impl !RefUnwindSafe for Closure
impl Send for Closure
impl Sync for Closure
impl Unpin for Closure
impl !UnwindSafe for Closure
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