MCPcopy Create free account

hub / github.com/benkay86/nom-tutorial / functions

Functions21 in github.com/benkay86/nom-tutorial

↓ 3 callersFunctionparse_line
Parse a line from `/proc/mounts` into a Mount struct. This is perhaps the most complex looking parser, but it is actually one of the simplest because
src/lib.rs:199
↓ 1 callersMethodinto_iter
Consuming iterator, used similarly to mutable iterator. See [Mounts::iter_mut()] for example.
src/lib.rs:75
↓ 1 callersFunctionmount_opts
Parse the options of a mount into a comma separated vector of strings. The options string is terminated by a whitespace. Here we use `nom::combinator
src/lib.rs:184
↓ 1 callersFunctionmounts
Convenience method equivalent to `Mounts::new()`.
src/lib.rs:348
↓ 1 callersFunctionnot_whitespace
Extract a string that does not contain whitespace (space or tab). Anything else goes.
src/lib.rs:162
↓ 1 callersFunctionparse_line_alternate
(i: &str)
src/lib.rs:250
Functionescaped_backslash
Replace the escaped sequence \ with a \. The inner parser `nom::character::complete::char` returns a `char` instead of a `&str`, so we wrap it in a `
src/lib.rs:172
Functionescaped_space
Replace the sequence 040 with a space.
src/lib.rs:167
Methodfmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/lib.rs:43
Methoditer_mut
Mutable iterator. # Examples ``` # use nom_tutorial; let mut iter = nom_tutorial::mounts().expect("Couldn't access /proc/mounts.").into_iter(); match
src/lib.rs:152
Functionmain
Prints a list of mounted filesystems similar to calling `mount` with no arguments.
src/main.rs:5
Methodnew
Returns a new Mounts instance. You can also call [mounts()] for convenience.
src/lib.rs:64
Methodnext
Returns the next line in `/proc/mounts` as a [Mount]. If there is a problem reading or parsing `/proc/mounts` returns an error. In the case of a par
src/lib.rs:99
Functiontest_escaped_backslash
()
src/lib.rs:294
Functiontest_escaped_space
()
src/lib.rs:287
Functiontest_mount_opts
()
src/lib.rs:309
Functiontest_not_whitespace
()
src/lib.rs:279
Functiontest_parse_line
()
src/lib.rs:315
Functiontest_parse_line_alternate
()
src/lib.rs:331
Functiontest_transform_escaped
()
src/lib.rs:302
Functiontransform_escaped
Replace all instances of \040 in a string with a space. Replace \\ with a \.
src/lib.rs:178