2024-05-05 09:43:20 +00:00
<!DOCTYPE html> < html lang = "en" > < head > < meta charset = "utf-8" > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > < meta name = "generator" content = "rustdoc" > < meta name = "description" content = "Trait for types the `Lexer` can read from." > < title > Source in logos::source - Rust< / title > < script > if ( window . location . protocol !== "file:" ) document . write ( ` <link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"> ` ) < / script > < link rel = "stylesheet" href = "../../static.files/normalize-76eba96aa4d2e634.css" > < link rel = "stylesheet" href = "../../static.files/rustdoc-e935ef01ae1c1829.css" > < meta name = "rustdoc-vars" data-root-path = "../../" data-static-root-path = "../../static.files/" data-current-crate = "logos" data-themes = "" data-resource-suffix = "" data-rustdoc-version = "1.78.0 (9b00956e5 2024-04-29)" data-channel = "1.78.0" data-search-js = "search-42d8da7a6b9792c2.js" data-settings-js = "settings-4313503d2e1961c2.js" > < script src = "../../static.files/storage-4c98445ec4002617.js" > < / script > < script defer src = "sidebar-items.js" > < / script > < script defer src = "../../static.files/main-12cf3b4f4f9dc36d.js" > < / script > < noscript > < link rel = "stylesheet" href = "../../static.files/noscript-04d5337699b92874.css" > < / noscript > < link rel = "alternate icon" type = "image/png" href = "../../static.files/favicon-16x16-8b506e7a72182f1c.png" > < link rel = "alternate icon" type = "image/png" href = "../../static.files/favicon-32x32-422f7d1d52889060.png" > < link rel = "icon" type = "image/svg+xml" href = "../../static.files/favicon-2c020d218678b618.svg" > < / head > < body class = "rustdoc trait" > <!-- [if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif] --> < nav class = "mobile-topbar" > < button class = "sidebar-menu-toggle" title = "show sidebar" > < / button > < a class = "logo-container" href = "../../logos/index.html" > < img src = "https://maciej.codes/kosz/logos.png" alt = "" > < / a > < / nav > < nav class = "sidebar" > < div class = "sidebar-crate" > < a class = "logo-container" href = "../../logos/index.html" > < img src = "https://maciej.codes/kosz/logos.png" alt = "logo" > < / a > < h2 > < a href = "../../logos/index.html" > logos< / a > < span class = "version" > 0.14.0< / span > < / h2 > < / div > < h2 class = "location" > < a href = "#" > Source< / a > < / h2 > < div class = "sidebar-elems" > < section > < h3 > < a href = "#required-associated-types" > Required Associated Types< / a > < / h3 > < ul class = "block" > < li > < a href = "#associatedtype.Slice" > Slice< / a > < / li > < / ul > < h3 > < a href = "#required-methods" > Required Methods< / a > < / h3 > < ul class = "block" > < li > < a href = "#tymethod.is_boundary" > is_boundary< / a > < / li > < li > < a href = "#tymethod.len" > len< / a > < / li > < li > < a href = "#tymethod.read" > read< / a > < / li > < li > < a href = "#tymethod.read_unchecked" > read_unchecked< / a > < / li > < li > < a href = "#tymethod.slice" > slice< / a > < / li > < li > < a href = "#tymethod.slice_unchecked" > slice_unchecked< / a > < / li > < / ul > < h3 > < a href = "#provided-methods" > Provided Methods< / a > < / h3 > < ul class = "block" > < li > < a href = "#method.find_boundary" > find_boundary< / a > < / li > < / ul > < h3 > < a href = "#foreign-impls" > Implementations on Foreign Types< / a > < / h3 > < ul class = "block" > < li > < a href = "#impl-Source-for-%5Bu8%5D" > [u8]< / a > < / li > < li > < a href = "#impl-Source-for-str" > str< / a > < / li > < / ul > < h3 > < a href = "#object-safety" > Object Safety< / a > < / h3 > < h3 > < a href = "#implementors" > Implementors< / a > < / h3 > < / section > < h2 > < a href = "index.html" > In logos::source< / a > < / h2 > < / div > < / nav > < div class = "sidebar-resizer" > < / div >
2024-02-13 06:38:44 +00:00
< main > < div class = "width-limiter" > < nav class = "sub" > < form class = "search-form" > < span > < / span > < div id = "sidebar-button" tabindex = "-1" > < a href = "../../logos/all.html" title = "show sidebar" > < / a > < / div > < input class = "search-input" name = "search" aria-label = "Run search in the documentation" autocomplete = "off" spellcheck = "false" placeholder = "Click or press ‘ S’ to search, ‘ ?’ for more options…" type = "search" > < div id = "help-button" tabindex = "-1" > < a href = "../../help.html" title = "help" > ?< / a > < / div > < div id = "settings-menu" tabindex = "-1" > < a href = "../../settings.html" title = "settings" > < img width = "22" height = "22" alt = "Change settings" src = "../../static.files/wheel-7b819b6101059cd0.svg" > < / a > < / div > < / form > < / nav > < section id = "main-content" class = "content" > < div class = "main-heading" > < h1 > Trait < a href = "../index.html" > logos< / a > ::< wbr > < a href = "index.html" > source< / a > ::< wbr > < a class = "trait" href = "#" > Source< / a > < button id = "copy-path" title = "Copy item path to clipboard" > < img src = "../../static.files/clipboard-7571035ce49a181d.svg" width = "19" height = "18" alt = "Copy item path" > < / button > < / h1 > < span class = "out-of-band" > < a class = "src" href = "../../src/logos/source.rs.html#16-98" > source< / a > · < button id = "toggle-all-docs" title = "collapse all docs" > [< span > − < / span > ]< / button > < / span > < / div > < pre class = "rust item-decl" > < code > pub trait Source {
2024-05-05 09:43:20 +00:00
type < a href = "#associatedtype.Slice" class = "associatedtype" > Slice< / a > < 'a> : < a class = "trait" href = "https://doc.rust-lang.org/1.78.0/core/cmp/trait.PartialEq.html" title = "trait core::cmp::PartialEq" > PartialEq< / a > + < a class = "trait" href = "https://doc.rust-lang.org/1.78.0/core/cmp/trait.Eq.html" title = "trait core::cmp::Eq" > Eq< / a > + < a class = "trait" href = "https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title = "trait core::fmt::Debug" > Debug< / a >
2024-02-13 06:38:44 +00:00
< span class = "where" > where Self: 'a< / span > ;
// Required methods
2024-05-05 09:43:20 +00:00
fn < a href = "#tymethod.len" class = "fn" > len< / a > (& self) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ;
< span class = "item-spacer" > < / span > fn < a href = "#tymethod.read" class = "fn" > read< / a > < 'a, Chunk> (& 'a self, offset: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "enum" href = "https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title = "enum core::option::Option" > Option< / a > < Chunk>
2024-02-13 06:38:44 +00:00
< span class = "where" > where Chunk: < a class = "trait" href = "trait.Chunk.html" title = "trait logos::source::Chunk" > Chunk< / a > < 'a> < / span > ;
2024-05-05 09:43:20 +00:00
< span class = "item-spacer" > < / span > unsafe fn < a href = "#tymethod.read_unchecked" class = "fn" > read_unchecked< / a > < 'a, Chunk> (& 'a self, offset: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> Chunk
2024-02-13 06:38:44 +00:00
< span class = "where" > where Chunk: < a class = "trait" href = "trait.Chunk.html" title = "trait logos::source::Chunk" > Chunk< / a > < 'a> < / span > ;
2024-05-05 09:43:20 +00:00
< span class = "item-spacer" > < / span > fn < a href = "#tymethod.slice" class = "fn" > slice< / a > (& self, range: < a class = "struct" href = "https://doc.rust-lang.org/1.78.0/core/ops/range/struct.Range.html" title = "struct core::ops::range::Range" > Range< / a > < < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > > ) -> < a class = "enum" href = "https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title = "enum core::option::Option" > Option< / a > < Self::< a class = "associatedtype" href = "trait.Source.html#associatedtype.Slice" title = "type logos::source::Source::Slice" > Slice< / a > < '_> > ;
< span class = "item-spacer" > < / span > unsafe fn < a href = "#tymethod.slice_unchecked" class = "fn" > slice_unchecked< / a > (& self, range: < a class = "struct" href = "https://doc.rust-lang.org/1.78.0/core/ops/range/struct.Range.html" title = "struct core::ops::range::Range" > Range< / a > < < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > > ) -> Self::< a class = "associatedtype" href = "trait.Source.html#associatedtype.Slice" title = "type logos::source::Source::Slice" > Slice< / a > < '_> ;
< span class = "item-spacer" > < / span > fn < a href = "#tymethod.is_boundary" class = "fn" > is_boundary< / a > (& self, index: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.bool.html" > bool< / a > ;
2024-02-13 06:38:44 +00:00
// Provided method
2024-05-05 09:43:20 +00:00
fn < a href = "#method.find_boundary" class = "fn" > find_boundary< / a > (& self, index: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > { ... }
2024-02-13 06:38:44 +00:00
}< / code > < / pre > < details class = "toggle top-doc" open > < summary class = "hideme" > < span > Expand description< / span > < / summary > < div class = "docblock" > < p > Trait for types the < code > Lexer< / code > can read from.< / p >
< p > Most notably this is implemented for < code > & str< / code > . It is unlikely you will
ever want to use this Trait yourself, unless implementing a new < code > Source< / code >
the < code > Lexer< / code > can use.< / p >
2024-05-05 09:43:20 +00:00
< / div > < / details > < h2 id = "required-associated-types" class = "section-header" > Required Associated Types< a href = "#required-associated-types" class = "anchor" > §< / a > < / h2 > < div class = "methods" > < details class = "toggle" open > < summary > < section id = "associatedtype.Slice" class = "method" > < a class = "src rightside" href = "../../src/logos/source.rs.html#18-20" > source< / a > < h4 class = "code-header" > type < a href = "#associatedtype.Slice" class = "associatedtype" > Slice< / a > < 'a> : < a class = "trait" href = "https://doc.rust-lang.org/1.78.0/core/cmp/trait.PartialEq.html" title = "trait core::cmp::PartialEq" > PartialEq< / a > + < a class = "trait" href = "https://doc.rust-lang.org/1.78.0/core/cmp/trait.Eq.html" title = "trait core::cmp::Eq" > Eq< / a > + < a class = "trait" href = "https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title = "trait core::fmt::Debug" > Debug< / a >
2024-02-13 06:38:44 +00:00
< span class = "where" > where
Self: 'a< / span > < / h4 > < / section > < / summary > < div class = "docblock" > < p > A type this < code > Source< / code > can be sliced into.< / p >
2024-05-05 09:43:20 +00:00
< / div > < / details > < / div > < h2 id = "required-methods" class = "section-header" > Required Methods< a href = "#required-methods" class = "anchor" > §< / a > < / h2 > < div class = "methods" > < details class = "toggle method-toggle" open > < summary > < section id = "tymethod.len" class = "method" > < a class = "src rightside" href = "../../src/logos/source.rs.html#23" > source< / a > < h4 class = "code-header" > fn < a href = "#tymethod.len" class = "fn" > len< / a > (& self) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > < / h4 > < / section > < / summary > < div class = "docblock" > < p > Length of the source< / p >
< / div > < / details > < details class = "toggle method-toggle" open > < summary > < section id = "tymethod.read" class = "method" > < a class = "src rightside" href = "../../src/logos/source.rs.html#42-44" > source< / a > < h4 class = "code-header" > fn < a href = "#tymethod.read" class = "fn" > read< / a > < 'a, Chunk> (& 'a self, offset: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "enum" href = "https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title = "enum core::option::Option" > Option< / a > < Chunk> < div class = "where" > where
2024-02-13 06:38:44 +00:00
Chunk: < a class = "trait" href = "trait.Chunk.html" title = "trait logos::source::Chunk" > Chunk< / a > < 'a> ,< / div > < / h4 > < / section > < / summary > < div class = "docblock" > < p > Read a chunk of bytes into an array. Returns < code > None< / code > when reading
out of bounds would occur.< / p >
< p > This is very useful for matching fixed-size byte arrays, and tends
to be very fast at it too, since the compiler knows the byte lengths.< / p >
< div class = "example-wrap" > < pre class = "rust rust-example-rendered" > < code > < span class = "kw" > use < / span > logos::Source;
< span class = "kw" > let < / span > foo = < span class = "string" > "foo"< / span > ;
< span class = "macro" > assert_eq!< / span > (foo.read(< span class = "number" > 0< / span > ), < span class = "prelude-val" > Some< / span > (< span class = "string" > b"foo"< / span > )); < span class = "comment" > // Option< & [u8; 3]>
< / span > < span class = "macro" > assert_eq!< / span > (foo.read(< span class = "number" > 0< / span > ), < span class = "prelude-val" > Some< / span > (< span class = "string" > b"fo"< / span > )); < span class = "comment" > // Option< & [u8; 2]>
< / span > < span class = "macro" > assert_eq!< / span > (foo.read(< span class = "number" > 2< / span > ), < span class = "prelude-val" > Some< / span > (< span class = "string" > b'o'< / span > )); < span class = "comment" > // Option< u8>
< / span > < span class = "macro" > assert_eq!< / span > (foo.read::< < span class = "kw-2" > & < / span > [u8; < span class = "number" > 4< / span > ]> (< span class = "number" > 0< / span > ), < span class = "prelude-val" > None< / span > ); < span class = "comment" > // Out of bounds
< / span > < span class = "macro" > assert_eq!< / span > (foo.read::< < span class = "kw-2" > & < / span > [u8; < span class = "number" > 2< / span > ]> (< span class = "number" > 2< / span > ), < span class = "prelude-val" > None< / span > ); < span class = "comment" > // Out of bounds< / span > < / code > < / pre > < / div >
2024-05-05 09:43:20 +00:00
< / div > < / details > < details class = "toggle method-toggle" open > < summary > < section id = "tymethod.read_unchecked" class = "method" > < a class = "src rightside" href = "../../src/logos/source.rs.html#51-53" > source< / a > < h4 class = "code-header" > unsafe fn < a href = "#tymethod.read_unchecked" class = "fn" > read_unchecked< / a > < 'a, Chunk> (& 'a self, offset: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> Chunk< div class = "where" > where
2024-02-13 06:38:44 +00:00
Chunk: < a class = "trait" href = "trait.Chunk.html" title = "trait logos::source::Chunk" > Chunk< / a > < 'a> ,< / div > < / h4 > < / section > < / summary > < div class = "docblock" > < p > Read a chunk of bytes into an array without doing bounds checks.< / p >
2024-03-27 11:12:16 +00:00
< h5 id = "safety" > < a class = "doc-anchor" href = "#safety" > §< / a > Safety< / h5 >
2024-02-13 06:38:44 +00:00
< p > Offset should not exceed bounds.< / p >
2024-05-05 09:43:20 +00:00
< / div > < / details > < details class = "toggle method-toggle" open > < summary > < section id = "tymethod.slice" class = "method" > < a class = "src rightside" href = "../../src/logos/source.rs.html#64" > source< / a > < h4 class = "code-header" > fn < a href = "#tymethod.slice" class = "fn" > slice< / a > (& self, range: < a class = "struct" href = "https://doc.rust-lang.org/1.78.0/core/ops/range/struct.Range.html" title = "struct core::ops::range::Range" > Range< / a > < < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > > ) -> < a class = "enum" href = "https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title = "enum core::option::Option" > Option< / a > < Self::< a class = "associatedtype" href = "trait.Source.html#associatedtype.Slice" title = "type logos::source::Source::Slice" > Slice< / a > < '_> > < / h4 > < / section > < / summary > < div class = "docblock" > < p > Get a slice of the source at given range. This is analogous to
2024-02-13 06:38:44 +00:00
< code > slice::get(range)< / code > .< / p >
< div class = "example-wrap" > < pre class = "rust rust-example-rendered" > < code > < span class = "kw" > use < / span > logos::Source;
< span class = "kw" > let < / span > foo = < span class = "string" > "It was the year when they finally immanentized the Eschaton."< / span > ;
< span class = "macro" > assert_eq!< / span > (< str < span class = "kw" > as < / span > Source> ::slice(< span class = "kw-2" > & < / span > foo, < span class = "number" > 51< / span > ..< span class = "number" > 59< / span > ), < span class = "prelude-val" > Some< / span > (< span class = "string" > "Eschaton"< / span > ));< / code > < / pre > < / div >
2024-05-05 09:43:20 +00:00
< / div > < / details > < details class = "toggle method-toggle" open > < summary > < section id = "tymethod.slice_unchecked" class = "method" > < a class = "src rightside" href = "../../src/logos/source.rs.html#82" > source< / a > < h4 class = "code-header" > unsafe fn < a href = "#tymethod.slice_unchecked" class = "fn" > slice_unchecked< / a > (& self, range: < a class = "struct" href = "https://doc.rust-lang.org/1.78.0/core/ops/range/struct.Range.html" title = "struct core::ops::range::Range" > Range< / a > < < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > > ) -> Self::< a class = "associatedtype" href = "trait.Source.html#associatedtype.Slice" title = "type logos::source::Source::Slice" > Slice< / a > < '_> < / h4 > < / section > < / summary > < div class = "docblock" > < p > Get a slice of the source at given range. This is analogous to
2024-02-13 06:38:44 +00:00
< code > slice::get_unchecked(range)< / code > .< / p >
2024-03-27 11:12:16 +00:00
< h5 id = "safety-1" > < a class = "doc-anchor" href = "#safety-1" > §< / a > Safety< / h5 >
2024-02-13 06:38:44 +00:00
< p > Range should not exceed bounds.< / p >
< div class = "example-wrap" > < pre class = "rust rust-example-rendered" > < code > < span class = "kw" > use < / span > logos::Source;
< span class = "kw" > let < / span > foo = < span class = "string" > "It was the year when they finally immanentized the Eschaton."< / span > ;
< span class = "kw" > unsafe < / span > {
< span class = "macro" > assert_eq!< / span > (< str < span class = "kw" > as < / span > Source> ::slice_unchecked(< span class = "kw-2" > & < / span > foo, < span class = "number" > 51< / span > ..< span class = "number" > 59< / span > ), < span class = "string" > "Eschaton"< / span > );
}< / code > < / pre > < / div >
2024-05-05 09:43:20 +00:00
< / div > < / details > < details class = "toggle method-toggle" open > < summary > < section id = "tymethod.is_boundary" class = "method" > < a class = "src rightside" href = "../../src/logos/source.rs.html#97" > source< / a > < h4 class = "code-header" > fn < a href = "#tymethod.is_boundary" class = "fn" > is_boundary< / a > (& self, index: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.bool.html" > bool< / a > < / h4 > < / section > < / summary > < div class = "docblock" > < p > Check if < code > index< / code > is valid for this < code > Source< / code > , that is:< / p >
2024-02-13 06:38:44 +00:00
< ul >
< li > It’ s not larger than the byte length of the < code > Source< / code > .< / li >
< li > (< code > str< / code > only) It doesn’ t land in the middle of a UTF-8 code point.< / li >
< / ul >
2024-05-05 09:43:20 +00:00
< / div > < / details > < / div > < h2 id = "provided-methods" class = "section-header" > Provided Methods< a href = "#provided-methods" class = "anchor" > §< / a > < / h2 > < div class = "methods" > < details class = "toggle method-toggle" open > < summary > < section id = "method.find_boundary" class = "method" > < a class = "src rightside" href = "../../src/logos/source.rs.html#89-91" > source< / a > < h4 class = "code-header" > fn < a href = "#method.find_boundary" class = "fn" > find_boundary< / a > (& self, index: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > < / h4 > < / section > < / summary > < div class = "docblock" > < p > For < code > & str< / code > sources attempts to find the closest < code > char< / code > boundary at which source
2024-02-13 06:38:44 +00:00
can be sliced, starting from < code > index< / code > .< / p >
< p > For binary sources (< code > & [u8]< / code > ) this should just return < code > index< / code > back.< / p >
2024-05-05 09:43:20 +00:00
< / div > < / details > < / div > < h2 id = "object-safety" class = "section-header" > Object Safety< a href = "#object-safety" class = "anchor" > §< / a > < / h2 > < div class = "object-safety-info" > This trait is < b > not< / b > < a href = "https://doc.rust-lang.org/1.78.0/reference/items/traits.html#object-safety" > object safe< / a > .< / div > < h2 id = "foreign-impls" class = "section-header" > Implementations on Foreign Types< a href = "#foreign-impls" class = "anchor" > §< / a > < / h2 > < details class = "toggle implementors-toggle" > < summary > < section id = "impl-Source-for-str" class = "impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#100-159" > source< / a > < a href = "#impl-Source-for-str" class = "anchor" > §< / a > < h3 class = "code-header" > impl < a class = "trait" href = "trait.Source.html" title = "trait logos::source::Source" > Source< / a > for < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.str.html" > str< / a > < / h3 > < / section > < / summary > < div class = "impl-items" > < section id = "associatedtype.Slice-1" class = "associatedtype trait-impl" > < a href = "#associatedtype.Slice-1" class = "anchor" > §< / a > < h4 class = "code-header" > type < a href = "#associatedtype.Slice" class = "associatedtype" > Slice< / a > < 'a> = & 'a < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.str.html" > str< / a > < / h4 > < / section > < section id = "method.len" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#104-106" > source< / a > < a href = "#method.len" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "#tymethod.len" class = "fn" > len< / a > (& self) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > < / h4 > < / section > < section id = "method.read" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#109-119" > source< / a > < a href = "#method.read" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "#tymethod.read" class = "fn" > read< / a > < 'a, Chunk> (& 'a self, offset: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "enum" href = "https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title = "enum core::option::Option" > Option< / a > < Chunk> < div class = "where" > where
Chunk: < a class = "trait" href = "trait.Chunk.html" title = "trait logos::source::Chunk" > Chunk< / a > < 'a> ,< / div > < / h4 > < / section > < section id = "method.read_unchecked" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#122-127" > source< / a > < a href = "#method.read_unchecked" class = "anchor" > §< / a > < h4 class = "code-header" > unsafe fn < a href = "#tymethod.read_unchecked" class = "fn" > read_unchecked< / a > < 'a, Chunk> (& 'a self, offset: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> Chunk< div class = "where" > where
Chunk: < a class = "trait" href = "trait.Chunk.html" title = "trait logos::source::Chunk" > Chunk< / a > < 'a> ,< / div > < / h4 > < / section > < section id = "method.slice" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#130-132" > source< / a > < a href = "#method.slice" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "#tymethod.slice" class = "fn" > slice< / a > (& self, range: < a class = "struct" href = "https://doc.rust-lang.org/1.78.0/core/ops/range/struct.Range.html" title = "struct core::ops::range::Range" > Range< / a > < < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > > ) -> < a class = "enum" href = "https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title = "enum core::option::Option" > Option< / a > < & < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.str.html" > str< / a > > < / h4 > < / section > < section id = "method.slice_unchecked" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#135-144" > source< / a > < a href = "#method.slice_unchecked" class = "anchor" > §< / a > < h4 class = "code-header" > unsafe fn < a href = "#tymethod.slice_unchecked" class = "fn" > slice_unchecked< / a > (& self, range: < a class = "struct" href = "https://doc.rust-lang.org/1.78.0/core/ops/range/struct.Range.html" title = "struct core::ops::range::Range" > Range< / a > < < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > > ) -> & < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.str.html" > str< / a > < / h4 > < / section > < section id = "method.find_boundary-1" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#147-153" > source< / a > < a href = "#method.find_boundary-1" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "#method.find_boundary" class = "fn" > find_boundary< / a > (& self, index: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > < / h4 > < / section > < section id = "method.is_boundary" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#156-158" > source< / a > < a href = "#method.is_boundary" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "#tymethod.is_boundary" class = "fn" > is_boundary< / a > (& self, index: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.bool.html" > bool< / a > < / h4 > < / section > < / div > < / details > < details class = "toggle implementors-toggle" > < summary > < section id = "impl-Source-for-%5Bu8%5D" class = "impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#161-210" > source< / a > < a href = "#impl-Source-for-%5Bu8%5D" class = "anchor" > §< / a > < h3 class = "code-header" > impl < a class = "trait" href = "trait.Source.html" title = "trait logos::source::Source" > Source< / a > for [< a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.u8.html" > u8< / a > ]< / h3 > < / section > < / summary > < div class = "impl-items" > < section id = "associatedtype.Slice-2" class = "associatedtype trait-impl" > < a href = "#associatedtype.Slice-2" class = "anchor" > §< / a > < h4 class = "code-header" > type < a href = "#associatedtype.Slice" class = "associatedtype" > Slice< / a > < 'a> = & 'a [< a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.u8.html" > u8< / a > ]< / h4 > < / section > < section id = "method.len-1" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#165-167" > source< / a > < a href = "#method.len-1" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "#tymethod.len" class = "fn" > len< / a > (& self) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > < / h4 > < / section > < section id = "method.read-1" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#170-179" > source< / a > < a href = "#method.read-1" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "#tymethod.read" class = "fn" > read< / a >
Chunk: < a class = "trait" href = "trait.Chunk.html" title = "trait logos::source::Chunk" > Chunk< / a > < 'a> ,< / div > < / h4 > < / section > < section id = "method.read_unchecked-1" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#182-187" > source< / a > < a href = "#method.read_unchecked-1" class = "anchor" > §< / a > < h4 class = "code-header" > unsafe fn < a href = "#tymethod.read_unchecked" class = "fn" > read_unchecked< / a > < 'a, Chunk> (& 'a self, offset: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> Chunk< div class = "where" > where
Chunk: < a class = "trait" href = "trait.Chunk.html" title = "trait logos::source::Chunk" > Chunk< / a > < 'a> ,< / div > < / h4 > < / section > < section id = "method.slice-1" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#190-192" > source< / a > < a href = "#method.slice-1" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "#tymethod.slice" class = "fn" > slice< / a > (& self, range: < a class = "struct" href = "https://doc.rust-lang.org/1.78.0/core/ops/range/struct.Range.html" title = "struct core::ops::range::Range" > Range< / a > < < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > > ) -> < a class = "enum" href = "https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title = "enum core::option::Option" > Option< / a > < & [< a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.u8.html" > u8< / a > ]> < / h4 > < / section > < section id = "method.slice_unchecked-1" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#195-204" > source< / a > < a href = "#method.slice_unchecked-1" class = "anchor" > §< / a > < h4 class = "code-header" > unsafe fn < a href = "#tymethod.slice_unchecked" class = "fn" > slice_unchecked< / a > (& self, range: < a class = "struct" href = "https://doc.rust-lang.org/1.78.0/core/ops/range/struct.Range.html" title = "struct core::ops::range::Range" > Range< / a > < < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > > ) -> & [< a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.u8.html" > u8< / a > ] < a href = "#" class = "tooltip" data-notable-ty = "&[u8]" > ⓘ< / a > < / h4 > < / section > < section id = "method.is_boundary-1" class = "method trait-impl" > < a class = "src rightside" href = "../../src/logos/source.rs.html#207-209" > source< / a > < a href = "#method.is_boundary-1" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "#tymethod.is_boundary" class = "fn" > is_boundary< / a > (& self, index: < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.usize.html" > usize< / a > ) -> < a class = "primitive" href = "https://doc.rust-lang.org/1.78.0/std/primitive.bool.html" > bool< / a > < / h4 > < / section > < / div > < / details > < h2 id = "implementors" class = "section-header" > Implementors< a href = "#implementors" class = "anchor" > §< / a > < / h2 > < div id = "implementors-list" > < / div > < script src = "../../trait.impl/logos/source/trait.Source.js" data-ignore-extern-crates = "std" async > < / script > < script type = "text/json" id = "notable-traits-data" > { "&[u8]" : "<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.78.0/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.78.0/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.78.0/std/primitive.u8.html\">u8</a>]</div>" } < / script > < / section > < / div > < / main > < / body > < / html >