pub struct Parser {}
Implementations§
Source§impl Parser
impl Parser
pub const REST_FILE_EXTENSIONS: [&str; 2]
pub fn has_valid_extension<T: AsRef<Path>>(path: &T) -> bool
Sourcepub fn parse_file(path: &Path) -> Result<HttpRestFile, ParseError>
pub fn parse_file(path: &Path) -> Result<HttpRestFile, ParseError>
Parse the contents of a file into a model::HttpRestFile
§Arguments
path
- path to a .http or .rest file
Sourcepub fn parse(string: &str, print_errors: bool) -> FileParseResult
pub fn parse(string: &str, print_errors: bool) -> FileParseResult
Parse the contents of a request file as string into multiple requests within a
model::FileParseResult
. This model contains all parsed requests as well as errors
encountered during parsing.
§Arguments
string
- string to parseprint_errors
- if set to true prints errors to the console
Sourcepub fn parse_request(scanner: &mut Scanner) -> Result<Request, ErrorWithPartial>
pub fn parse_request(scanner: &mut Scanner) -> Result<Request, ErrorWithPartial>
Parse a single request either until no further lines are present or a REQUEST_SEPARATOR
is encountered
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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