MCPcopy Create free account
hub / github.com/bootc-dev/bootc / parse

Method parse

crates/kernel_cmdline/src/bytes.rs:476–480  ·  view source on GitHub ↗

Attempt to parse a single command line parameter from a slice of bytes. Returns `Some(Parameter)`, or `None` if a Parameter could not be constructed from the input. This occurs when the input is either empty or contains only whitespace. If the input contains multiple parameters, only the first one is parsed and the rest is discarded.

(input: &'a T)

Source from the content-addressed store, hash-verified

474 /// If the input contains multiple parameters, only the first one
475 /// is parsed and the rest is discarded.
476 pub fn parse<T: AsRef<[u8]> + ?Sized>(input: &'a T) -> Option<Self> {
477 CmdlineIterBytes(input.as_ref())
478 .next()
479 .and_then(Self::parse_internal)
480 }
481
482 /// Parse a parameter from a byte slice that contains exactly one parameter.
483 ///

Callers

nothing calls this directly

Calls 3

CmdlineIterBytesClass · 0.85
nextMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected