MCPcopy Create free account
hub / github.com/bitflags/bitflags / from_str_truncate

Function from_str_truncate

src/parser.rs:155–160  ·  view source on GitHub ↗

Parse a flags value from text. This function will fail on any names that don't correspond to defined flags. Unknown bits will be ignored. */

(input: &str)

Source from the content-addressed store, hash-verified

153Unknown bits will be ignored.
154*/
155pub fn from_str_truncate<B: Flags>(input: &str) -> Result<B, ParseError>
156where
157 B::Bits: ParseHex,
158{
159 Ok(B::from_bits_truncate(from_str::<B>(input)?.bits()))
160}
161
162/**
163Write only the contained, defined, named flags in a flags value as text.

Callers

nothing calls this directly

Calls 2

OkClass · 0.85
bitsMethod · 0.45

Tested by

no test coverage detected