Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/benkay86/nom-tutorial
/ functions
Functions
21 in github.com/benkay86/nom-tutorial
⨍
Functions
21
◇
Types & classes
4
↓ 3 callers
Function
parse_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 callers
Method
into_iter
Consuming iterator, used similarly to mutable iterator. See [Mounts::iter_mut()] for example.
src/lib.rs:75
↓ 1 callers
Function
mount_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 callers
Function
mounts
Convenience method equivalent to `Mounts::new()`.
src/lib.rs:348
↓ 1 callers
Function
not_whitespace
Extract a string that does not contain whitespace (space or tab). Anything else goes.
src/lib.rs:162
↓ 1 callers
Function
parse_line_alternate
(i: &str)
src/lib.rs:250
Function
escaped_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
Function
escaped_space
Replace the sequence 040 with a space.
src/lib.rs:167
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/lib.rs:43
Method
iter_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
Function
main
Prints a list of mounted filesystems similar to calling `mount` with no arguments.
src/main.rs:5
Method
new
Returns a new Mounts instance. You can also call [mounts()] for convenience.
src/lib.rs:64
Method
next
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
Function
test_escaped_backslash
()
src/lib.rs:294
Function
test_escaped_space
()
src/lib.rs:287
Function
test_mount_opts
()
src/lib.rs:309
Function
test_not_whitespace
()
src/lib.rs:279
Function
test_parse_line
()
src/lib.rs:315
Function
test_parse_line_alternate
()
src/lib.rs:331
Function
test_transform_escaped
()
src/lib.rs:302
Function
transform_escaped
Replace all instances of \040 in a string with a space. Replace \\ with a \.
src/lib.rs:178