Debian Codegraph @

src/lib.rs

raw symbols SCIP
1 //! A native Rust library for Mozilla's Public Suffix List
2
3 #![no_std]
4 #![forbid(unsafe_code)]
5
6 mod listrust-analyzer cargo psl 2.1.223 list/;
7
8 #[cfg(feature = "helpers")]
9 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/;
10
11 pub use psl_typesrust-analyzer cargo psl-types 2.0.11 crate/::{Domainrust-analyzer cargo psl-types 2.0.11 Domain#, Inforust-analyzer cargo psl-types 2.0.11 Info#, Listrust-analyzer cargo psl-types 2.0.11 List# as Pslrust-analyzer cargo psl-types 2.0.11 List#, Suffixrust-analyzer cargo psl-types 2.0.11 Suffix#, Typerust-analyzer cargo psl-types 2.0.11 Type#};
12
13 /// A static public suffix list
14 pub struct Listrust-analyzer cargo psl 2.1.223 List#;
15
16 impl Pslrust-analyzer cargo psl-types 2.0.11 List# for Listrust-analyzer cargo psl 2.1.223 List# {
17 #[inline]
18 fn findrust-analyzer cargo psl 2.1.223 impl#[List][List]find().<'a, T>(&self, labels: T) -> Inforust-analyzer cargo psl-types 2.0.11 Info#
19 where
20 T: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = &'a [u8]>,
21 {
22 listrust-analyzer cargo psl 2.1.223 list/::lookuprust-analyzer cargo psl 2.1.223 list/lookup().(labels)
23 }
24 }
25
26 /// Get the public suffix of the domain
27 #[cfg(feature = "helpers")]
28 #[inline]
29 pub fn suffixrust-analyzer cargo psl 2.1.223 suffix().(name: &[u8]) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Suffixrust-analyzer cargo psl-types 2.0.11 Suffix#<'_>> {
30 Listrust-analyzer cargo psl 2.1.223 List#.suffixrust-analyzer cargo psl-types 2.0.11 List#suffix().(name)
31 }
32
33 /// Get the public suffix of the domain
34 #[cfg(feature = "helpers")]
35 #[inline]
36 pub fn suffix_strrust-analyzer cargo psl 2.1.223 suffix_str().(name: &str) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> {
37 let bytes = suffixrust-analyzer cargo psl 2.1.223 suffix().(name.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Try]branch()..trimrust-analyzer cargo psl-types 2.0.11 impl#[`Suffix<'a>`]trim().().as_bytesrust-analyzer cargo psl-types 2.0.11 impl#[`Suffix<'a>`]as_bytes().();
38 strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/::from_utf8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/converts/from_utf8().(bytes).okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().()
39 }
40
41 /// Get the registrable domain
42 #[cfg(feature = "helpers")]
43 #[inline]
44 pub fn domainrust-analyzer cargo psl 2.1.223 domain().(name: &[u8]) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Domainrust-analyzer cargo psl-types 2.0.11 Domain#<'_>> {
45 Listrust-analyzer cargo psl 2.1.223 List#.domainrust-analyzer cargo psl-types 2.0.11 List#domain().(name)
46 }
47
48 /// Get the registrable domain
49 #[cfg(feature = "helpers")]
50 #[inline]
51 pub fn domain_strrust-analyzer cargo psl 2.1.223 domain_str().(name: &str) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> {
52 let bytes = domainrust-analyzer cargo psl 2.1.223 domain().(name.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Try]branch()..trimrust-analyzer cargo psl-types 2.0.11 impl#[`Domain<'a>`]trim().().as_bytesrust-analyzer cargo psl-types 2.0.11 impl#[`Domain<'a>`]as_bytes().();
53 strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/::from_utf8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/converts/from_utf8().(bytes).okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]ok().()
54 }