diff --git a/actix_web/all.html b/actix_web/all.html index 6aba7c4..4e38aa6 100644 --- a/actix_web/all.html +++ b/actix_web/all.html @@ -1,5 +1,7 @@ -
pub const CACHE_AGE: u32 = 60 * 60 * 24 * 365; // 0x01e1_3380u32
pub(crate) fn handle_assets(path: &str) -> HttpResponse
pub(crate) fn handle_assets(path: &str) -> HttpResponse
pub(crate) fn handle_favicons(path: &str) -> HttpResponse
pub(crate) fn handle_favicons(path: &str) -> HttpResponse
pub(crate) fn services(cfg: &mut ServiceConfig)
pub fn get_index() -> String
pub(crate) struct Asset;
pub(crate) struct Asset;
Mutably borrows from an owned value. Read more
-Attaches the provided Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
Mutably borrows from an owned value. Read more
+Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub struct FILES {
- pub(crate) __private_field: (),
+FILES in actix_web - Rust
+
+ pub struct FILES {
+ pub(crate) __private_field: (),
}
Expand description
- create filemap
-Fields
__private_field: ()
Methods from Deref<Target = Files>
Fields
__private_field: ()
Methods from Deref<Target = Files>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FILES
impl UnwindSafe for FILES
Blanket Implementations
Mutably borrows from an owned value. Read more
-
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
-
Attaches the current default Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
-
+Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FILES
impl Send for FILES
impl Sync for FILES
impl Unpin for FILES
impl UnwindSafe for FILES
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
+sourceimpl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
+sourcefn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
+
pub(crate) struct Favicons;
Mutably borrows from an owned value. Read more
-Attaches the provided Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
pub(crate) struct Favicons;
Mutably borrows from an owned value. Read more
+Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub struct INDEX {
- pub(crate) __private_field: (),
-}
__private_field: ()
Extracts a string slice containing the entire String
.
pub struct INDEX {
+ pub(crate) __private_field: (),
+}
__private_field: ()
Extracts a string slice containing the entire String
.
Basic usage:
let s = String::from("foo");
assert_eq!("foo", s.as_str());
Returns this String
’s capacity, in bytes.
Basic usage:
let s = String::with_capacity(10);
assert!(s.capacity() >= 10);
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the length of this String
, in bytes, not char
s or
graphemes. In other words, it might not be what a human considers the
length of the string.
Basic usage:
let a = String::from("foo");
@@ -35,8 +40,8 @@ length of the string.
let fancy_f = String::from("ƒoo");
assert_eq!(fancy_f.len(), 4);
assert_eq!(fancy_f.chars().count(), 3);
Returns true
if this String
has a length of zero, and false
otherwise.
Returns the length of self
.
This length is in bytes, not char
s or graphemes. In other words,
it might not be what a human considers the length of the string.
Basic usage:
let len = "foo".len();
@@ -55,8 +60,8 @@ it might not be what a human considers the length of the string.
assert_eq!("ƒoo".len(), 4); // fancy f!
assert_eq!("ƒoo".chars().count(), 3);
Returns true
if self
has a length of zero bytes.
Returns true
if self
has a length of zero bytes.
Basic usage:
let s = "";
@@ -64,12 +69,12 @@ it might not be what a human considers the length of the string.
let s = "not empty";
assert!(!s.is_empty());
Checks that index
-th byte is the first byte in a UTF-8 code point
+
Checks that index
-th byte is the first byte in a UTF-8 code point
sequence or the end of the string.
The start and end of the string (when index == self.len()
) are
considered to be boundaries.
Returns false
if index
is greater than self.len()
.
let s = "Löwe 老虎 Léopard";
assert!(s.is_char_boundary(0));
// start of `老`
@@ -81,28 +86,57 @@ considered to be boundaries.
// third byte of `老`
assert!(!s.is_char_boundary(8));
round_char_boundary
)Finds the closest x
not exceeding index
where is_char_boundary(x)
is true
.
This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t +exceed a given number of bytes. Note that this is done purely at the character level +and can still visually split graphemes, even though the underlying characters aren’t +split. For example, the emoji 🧑🔬 (scientist) could be split so that the string only +includes 🧑 (person) instead.
+#![feature(round_char_boundary)]
+let s = "❤️🧡💛💚💙💜";
+assert_eq!(s.len(), 26);
+assert!(!s.is_char_boundary(13));
+
+let closest = s.floor_char_boundary(13);
+assert_eq!(closest, 10);
+assert_eq!(&s[..closest], "❤️🧡");
round_char_boundary
)Finds the closest x
not below index
where is_char_boundary(x)
is true
.
This method is the natural complement to floor_char_boundary
. See that method
+for more details.
Panics if index > self.len()
.
#![feature(round_char_boundary)]
+let s = "❤️🧡💛💚💙💜";
+assert_eq!(s.len(), 26);
+assert!(!s.is_char_boundary(13));
+
+let closest = s.ceil_char_boundary(13);
+assert_eq!(closest, 14);
+assert_eq!(&s[..closest], "❤️🧡💛");
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Converts a string slice to a raw pointer.
+Converts a string slice to a raw pointer.
As string slices are a slice of bytes, the raw pointer points to a
-u8
. This pointer will be pointing to the first byte of the string
+u8
. This pointer will be pointing to the first byte of the string
slice.
The caller must ensure that the returned pointer is never written to.
-If you need to mutate the contents of the string slice, use as_mut_ptr
.
as_mut_ptr
.
+Basic usage:
let s = "Hello";
let ptr = s.as_ptr();
Returns a subslice of str
.
Returns a subslice of str
.
This is the non-panicking alternative to indexing the str
. Returns
-None
whenever equivalent indexing operation would panic.
None
whenever equivalent indexing operation would panic.
+let v = String::from("🗻∈🌏");
assert_eq!(Some("🗻"), v.get(0..4));
@@ -113,9 +147,9 @@ If you need to mutate the contents of the string slice, use // out of bounds
assert!(v.get(..42).is_none());
Returns an unchecked subslice of str
.
Returns an unchecked subslice of str
.
This is the unchecked alternative to indexing the str
.
Callers of this function are responsible that these preconditions are satisfied:
Failing that, the returned string slice may reference invalid memory or
violate the invariants communicated by the str
type.
let v = "🗻∈🌏";
unsafe {
assert_eq!("🗻", v.get_unchecked(0..4));
assert_eq!("∈", v.get_unchecked(4..7));
assert_eq!("🌏", v.get_unchecked(7..11));
}
use get_unchecked(begin..end)
instead
use get_unchecked(begin..end)
instead
Creates a string slice from another string slice, bypassing safety checks.
This is generally not recommended, use with caution! For a safe
-alternative see str
and Index
.
str
and Index
.
This new slice goes from begin
to end
, including begin
but
excluding end
.
To get a mutable string slice instead, see the
-slice_mut_unchecked
method.
slice_mut_unchecked
method.
+Callers of this function are responsible that three preconditions are satisfied:
begin
and end
must be byte positions within the string slice.begin
and end
must lie on UTF-8 sequence boundaries.Basic usage:
let s = "Löwe 老虎 Léopard";
@@ -163,17 +197,17 @@ satisfied:
unsafe {
assert_eq!("world", s.slice_unchecked(7, 12));
}
Divide one string slice into two at an index.
+Divide one string slice into two at an index.
The argument, mid
, should be a byte offset from the start of the
string. It must also be on the boundary of a UTF-8 code point.
The two slices returned go from the start of the string slice to mid
,
and from mid
to the end of the string slice.
To get mutable string slices instead, see the split_at_mut
+
To get mutable string slices instead, see the split_at_mut
method.
Panics if mid
is not on a UTF-8 code point boundary, or if it is
past the end of the last code point of the string slice.
Basic usage:
let s = "Per Martin-Löf";
@@ -182,14 +216,14 @@ past the end of the last code point of the string slice.
assert_eq!("Per", first);
assert_eq!(" Martin-Löf", last);
Returns an iterator over the char
s of a string slice.
As a string slice consists of valid UTF-8, we can iterate through a
-string slice by char
. This method returns such an iterator.
It’s important to remember that char
represents a Unicode Scalar
+string slice by char
. This method returns such an iterator.
It’s important to remember that char
represents a Unicode Scalar
Value, and might not match your idea of what a ‘character’ is. Iteration
over grapheme clusters may be what you actually want. This functionality
is not provided by Rust’s standard library, check crates.io instead.
Basic usage:
let word = "goodbye";
@@ -208,7 +242,7 @@ is not provided by Rust’s standard library, check crates.io instead.
assert_eq!(Some('e'), chars.next());
assert_eq!(None, chars.next());
Remember, char
s might not match your intuition about characters:
Remember, char
s might not match your intuition about characters:
let y = "y̆";
@@ -218,14 +252,14 @@ is not provided by Rust’s standard library, check crates.io instead.
assert_eq!(Some('\u{0306}'), chars.next());
assert_eq!(None, chars.next());
Returns an iterator over the char
s of a string slice, and their
+
Returns an iterator over the char
s of a string slice, and their
positions.
As a string slice consists of valid UTF-8, we can iterate through a
-string slice by char
. This method returns an iterator of both
-these char
s, as well as their byte positions.
The iterator yields tuples. The position is first, the char
is
+string slice by char
. This method returns an iterator of both
+these char
s, as well as their byte positions.
The iterator yields tuples. The position is first, the char
is
second.
Basic usage:
let word = "goodbye";
@@ -244,7 +278,7 @@ second.
assert_eq!(Some((6, 'e')), char_indices.next());
assert_eq!(None, char_indices.next());
Remember, char
s might not match your intuition about characters:
Remember, char
s might not match your intuition about characters:
let yes = "y̆es";
@@ -258,10 +292,10 @@ second.
assert_eq!(Some((4, 's')), char_indices.next());
assert_eq!(None, char_indices.next());
An iterator over the bytes of a string slice.
As a string slice consists of a sequence of bytes, we can iterate through a string slice by byte. This method returns such an iterator.
-Basic usage:
let mut bytes = "bors".bytes();
@@ -272,13 +306,13 @@ through a string slice by byte. This method returns such an iterator.
assert_eq!(Some(b's'), bytes.next());
assert_eq!(None, bytes.next());
Splits a string slice by whitespace.
+Splits a string slice by whitespace.
The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of whitespace.
‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property White_Space
. If you only want to split on ASCII whitespace
-instead, use split_ascii_whitespace
.
split_ascii_whitespace
.
+Basic usage:
let mut iter = "A few words".split_whitespace();
@@ -298,11 +332,11 @@ instead, use assert_eq!(Some("lamb"), iter.next());
assert_eq!(None, iter.next());
Splits a string slice by ASCII whitespace.
+Splits a string slice by ASCII whitespace.
The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of ASCII whitespace.
-To split by Unicode Whitespace
instead, use split_whitespace
.
To split by Unicode Whitespace
instead, use split_whitespace
.
Basic usage:
let mut iter = "A few words".split_ascii_whitespace();
@@ -322,13 +356,13 @@ the original string slice, separated by any amount of ASCII whitespace.
assert_eq!(Some("lamb"), iter.next());
assert_eq!(None, iter.next());
An iterator over the lines of a string, as string slices.
+An iterator over the lines of a string, as string slices.
Lines are ended with either a newline (\n
) or a carriage return with
a line feed (\r\n
).
The final line ending is optional. A string that ends with a final line ending will return the same lines as an otherwise identical string without a final line ending.
-Basic usage:
let text = "foo\r\nbar\n\nbaz\n";
@@ -351,10 +385,10 @@ without a final line ending.
assert_eq!(Some("baz"), lines.next());
assert_eq!(None, lines.next());
use lines() instead now
+use lines() instead now
An iterator over the lines of a string.
-Returns an iterator of u16
over the string encoded as UTF-16.
Returns an iterator of u16
over the string encoded as UTF-16.
Basic usage:
let text = "Zażółć gęślą jaźń";
@@ -363,48 +397,48 @@ without a final line ending.
let utf16_len = text.encode_utf16().count();
assert!(utf16_len <= utf8_len);
Returns true
if the given pattern matches a sub-slice of
+
Returns true
if the given pattern matches a sub-slice of
this string slice.
Returns false
if it does not.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
Basic usage:
let bananas = "bananas";
assert!(bananas.contains("nana"));
assert!(!bananas.contains("apples"));
Returns true
if the given pattern matches a prefix of this
+
Returns true
if the given pattern matches a prefix of this
string slice.
Returns false
if it does not.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
Basic usage:
let bananas = "bananas";
assert!(bananas.starts_with("bana"));
assert!(!bananas.starts_with("nana"));
Returns true
if the given pattern matches a suffix of this
+
Returns true
if the given pattern matches a suffix of this
string slice.
Returns false
if it does not.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
Basic usage:
let bananas = "bananas";
assert!(bananas.ends_with("anas"));
assert!(!bananas.ends_with("nana"));
Returns the byte index of the first character of this string slice that +
Returns the byte index of the first character of this string slice that matches the pattern.
-Returns None
if the pattern doesn’t match.
The pattern can be a &str
, char
, a slice of char
s, or a
+
Returns None
if the pattern doesn’t match.
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
Simple patterns:
let s = "Löwe 老虎 Léopard Gepardi";
@@ -426,12 +460,12 @@ function or closure that determines if a character matches.
let x: &[_] = &['1', '2'];
assert_eq!(s.find(x), None);
Returns the byte index for the first character of the rightmost match of the pattern in +
Returns the byte index for the first character of the rightmost match of the pattern in this string slice.
-Returns None
if the pattern doesn’t match.
The pattern can be a &str
, char
, a slice of char
s, or a
+
Returns None
if the pattern doesn’t match.
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
Simple patterns:
let s = "Löwe 老虎 Léopard Gepardi";
@@ -451,17 +485,17 @@ function or closure that determines if a character matches.
let x: &[_] = &['1', '2'];
assert_eq!(s.rfind(x), None);
An iterator over substrings of this string slice, separated by +
An iterator over substrings of this string slice, separated by characters matched by a pattern.
-The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
The returned iterator will be a DoubleEndedIterator
if the pattern
+
The returned iterator will be a DoubleEndedIterator
if the pattern
allows a reverse search and forward/reverse search yields the same
-elements. This is true for, e.g., char
, but not for &str
.
char
, but not for &str
.
If the pattern allows a reverse search but its results might differ
-from a forward search, the rsplit
method can be used.
rsplit
method can be used.
+Simple patterns:
let v: Vec<&str> = "Mary had a little lamb".split(' ').collect();
@@ -523,14 +557,14 @@ when whitespace is used as the separator. This code is correct:
It does not give you:
ⓘassert_eq!(d, &["a", "b", "c"]);
-Use split_whitespace
for this behavior.
-
An iterator over substrings of this string slice, separated by +
Use split_whitespace
for this behavior.
An iterator over substrings of this string slice, separated by
characters matched by a pattern. Differs from the iterator produced by
split
in that split_inclusive
leaves the matched part as the
terminator of the substring.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb."
.split_inclusive('\n').collect();
assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb."]);
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
.split_inclusive('\n').collect();
assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb.\n"]);
An iterator over substrings of the given string slice, separated by +
An iterator over substrings of the given string slice, separated by characters matched by a pattern and yielded in reverse order.
-The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
The returned iterator requires that the pattern supports a reverse
-search, and it will be a DoubleEndedIterator
if a forward/reverse
+search, and it will be a DoubleEndedIterator
if a forward/reverse
search yields the same elements.
For iterating from the front, the split
method can be used.
For iterating from the front, the split
method can be used.
Simple patterns:
let v: Vec<&str> = "Mary had a little lamb".rsplit(' ').collect();
@@ -568,21 +602,21 @@ search yields the same elements.
let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
assert_eq!(v, ["ghi", "def", "abc"]);
-
An iterator over substrings of the given string slice, separated by +
An iterator over substrings of the given string slice, separated by characters matched by a pattern.
-The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
Equivalent to split
, except that the trailing substring
+
Equivalent to split
, except that the trailing substring
is skipped if empty.
This method can be used for string data that is terminated, rather than separated by a pattern.
-The returned iterator will be a DoubleEndedIterator
if the pattern
+
The returned iterator will be a DoubleEndedIterator
if the pattern
allows a reverse search and forward/reverse search yields the same
-elements. This is true for, e.g., char
, but not for &str
.
char
, but not for &str
.
If the pattern allows a reverse search but its results might differ
-from a forward search, the rsplit_terminator
method can be used.
rsplit_terminator
method can be used.
+Basic usage:
let v: Vec<&str> = "A.B.".split_terminator('.').collect();
@@ -593,21 +627,21 @@ from a forward search, the let v: Vec<&str> = "A.B:C.D".split_terminator(&['.', ':'][..]).collect();
assert_eq!(v, ["A", "B", "C", "D"]);
An iterator over substrings of self
, separated by characters
+
An iterator over substrings of self
, separated by characters
matched by a pattern and yielded in reverse order.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
Equivalent to split
, except that the trailing substring is
+
Equivalent to split
, except that the trailing substring is
skipped if empty.
This method can be used for string data that is terminated, rather than separated by a pattern.
-The returned iterator requires that the pattern supports a reverse search, and it will be double ended if a forward/reverse search yields the same elements.
-For iterating from the front, the split_terminator
method can be
+
For iterating from the front, the split_terminator
method can be
used.
let v: Vec<&str> = "A.B.".rsplit_terminator('.').collect();
assert_eq!(v, ["B", "A"]);
@@ -616,18 +650,18 @@ used.
let v: Vec<&str> = "A.B:C.D".rsplit_terminator(&['.', ':'][..]).collect();
assert_eq!(v, ["D", "C", "B", "A"]);
An iterator over substrings of the given string slice, separated by a +
An iterator over substrings of the given string slice, separated by a
pattern, restricted to returning at most n
items.
If n
substrings are returned, the last substring (the n
th substring)
will contain the remainder of the string.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
The returned iterator will not be double ended, because it is not efficient to support.
-If the pattern allows a reverse search, the rsplitn
method can be
+
If the pattern allows a reverse search, the rsplitn
method can be
used.
Simple patterns:
let v: Vec<&str> = "Mary had a little lambda".splitn(3, ' ').collect();
@@ -645,18 +679,18 @@ used.
let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
assert_eq!(v, ["abc", "defXghi"]);
-
An iterator over substrings of this string slice, separated by a +
An iterator over substrings of this string slice, separated by a
pattern, starting from the end of the string, restricted to returning
at most n
items.
If n
substrings are returned, the last substring (the n
th substring)
will contain the remainder of the string.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
The returned iterator will not be double ended, because it is not efficient to support.
-For splitting from the front, the splitn
method can be used.
For splitting from the front, the splitn
method can be used.
Simple patterns:
let v: Vec<&str> = "Mary had a little lamb".rsplitn(3, ' ').collect();
@@ -671,29 +705,29 @@ efficient to support.
let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
assert_eq!(v, ["ghi", "abc1def"]);
-
Splits the string on the first occurrence of the specified delimiter and +
Splits the string on the first occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.
-assert_eq!("cfg".split_once('='), None);
assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
Splits the string on the last occurrence of the specified delimiter and +
Splits the string on the last occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.
-assert_eq!("cfg".rsplit_once('='), None);
assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
An iterator over the disjoint matches of a pattern within the given string +
An iterator over the disjoint matches of a pattern within the given string slice.
-The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
The returned iterator will be a DoubleEndedIterator
if the pattern
+
The returned iterator will be a DoubleEndedIterator
if the pattern
allows a reverse search and forward/reverse search yields the same
-elements. This is true for, e.g., char
, but not for &str
.
char
, but not for &str
.
If the pattern allows a reverse search but its results might differ
-from a forward search, the rmatches
method can be used.
rmatches
method can be used.
+Basic usage:
let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
@@ -701,16 +735,16 @@ from a forward search, the let v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect();
assert_eq!(v, ["1", "2", "3"]);
An iterator over the disjoint matches of a pattern within this string slice, +
An iterator over the disjoint matches of a pattern within this string slice, yielded in reverse order.
-The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
The returned iterator requires that the pattern supports a reverse
-search, and it will be a DoubleEndedIterator
if a forward/reverse
+search, and it will be a DoubleEndedIterator
if a forward/reverse
search yields the same elements.
For iterating from the front, the matches
method can be used.
For iterating from the front, the matches
method can be used.
Basic usage:
let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
@@ -718,19 +752,19 @@ search yields the same elements.
let v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect();
assert_eq!(v, ["3", "2", "1"]);
An iterator over the disjoint matches of a pattern within this string +
An iterator over the disjoint matches of a pattern within this string slice as well as the index that the match starts at.
For matches of pat
within self
that overlap, only the indices
corresponding to the first match are returned.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
The returned iterator will be a DoubleEndedIterator
if the pattern
+
The returned iterator will be a DoubleEndedIterator
if the pattern
allows a reverse search and forward/reverse search yields the same
-elements. This is true for, e.g., char
, but not for &str
.
char
, but not for &str
.
If the pattern allows a reverse search but its results might differ
-from a forward search, the rmatch_indices
method can be used.
rmatch_indices
method can be used.
+Basic usage:
let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
@@ -741,18 +775,18 @@ from a forward search, the let v: Vec<_> = "ababa".match_indices("aba").collect();
assert_eq!(v, [(0, "aba")]); // only the first `aba`
An iterator over the disjoint matches of a pattern within self
,
+
An iterator over the disjoint matches of a pattern within self
,
yielded in reverse order along with the index of the match.
For matches of pat
within self
that overlap, only the indices
corresponding to the last match are returned.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
The returned iterator requires that the pattern supports a reverse
-search, and it will be a DoubleEndedIterator
if a forward/reverse
+search, and it will be a DoubleEndedIterator
if a forward/reverse
search yields the same elements.
For iterating from the front, the match_indices
method can be used.
For iterating from the front, the match_indices
method can be used.
Basic usage:
let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
@@ -763,24 +797,24 @@ search yields the same elements.
let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
assert_eq!(v, [(2, "aba")]); // only the last `aba`
Returns a string slice with leading and trailing whitespace removed.
+Returns a string slice with leading whitespace removed.
+Returns a string slice with leading whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property White_Space
.
A string is a sequence of bytes. start
in this context means the first
position of that byte string; for a left-to-right language like English or
Russian, this will be left side, and for right-to-left languages like
Arabic or Hebrew, this will be the right side.
Basic usage:
let s = " Hello\tworld\t";
@@ -792,15 +826,15 @@ Arabic or Hebrew, this will be the right side.
let s = " עברית ";
assert!(Some('ע') == s.trim_start().chars().next());
Returns a string slice with trailing whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property White_Space
.
A string is a sequence of bytes. end
in this context means the last
position of that byte string; for a left-to-right language like English or
Russian, this will be right side, and for right-to-left languages like
Arabic or Hebrew, this will be the left side.
Basic usage:
let s = " Hello\tworld\t";
@@ -812,16 +846,16 @@ Arabic or Hebrew, this will be the left side.
let s = " עברית ";
assert!(Some('ת') == s.trim_end().chars().rev().next());
superseded by trim_start
superseded by trim_start
Returns a string slice with leading whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property White_Space
.
A string is a sequence of bytes. ‘Left’ in this context means the first position of that byte string; for a language like Arabic or Hebrew which are ‘right to left’ rather than ‘left to right’, this will be the right side, not the left.
-Basic usage:
let s = " Hello\tworld\t";
@@ -834,16 +868,16 @@ the right side, not the left.
let s = " עברית";
assert!(Some('ע') == s.trim_left().chars().next());
superseded by trim_end
superseded by trim_end
Returns a string slice with trailing whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property White_Space
.
A string is a sequence of bytes. ‘Right’ in this context means the last position of that byte string; for a language like Arabic or Hebrew which are ‘right to left’ rather than ‘left to right’, this will be the left side, not the right.
-Basic usage:
let s = " Hello\tworld\t";
@@ -856,11 +890,11 @@ the left side, not the right.
let s = "עברית ";
assert!(Some('ת') == s.trim_right().chars().rev().next());
Returns a string slice with all prefixes and suffixes that match a +
Returns a string slice with all prefixes and suffixes that match a pattern repeatedly removed.
-The pattern can be a char
, a slice of char
s, or a function
+
The pattern can be a char
, a slice of char
s, or a function
or closure that determines if a character matches.
Simple patterns:
assert_eq!("11foo1bar11".trim_matches('1'), "foo1bar");
@@ -871,16 +905,16 @@ or closure that determines if a character matches.
A more complex pattern, using a closure:
assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
-
Returns a string slice with all prefixes that match a pattern +
Returns a string slice with all prefixes that match a pattern repeatedly removed.
-The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
A string is a sequence of bytes. start
in this context means the first
position of that byte string; for a left-to-right language like English or
Russian, this will be left side, and for right-to-left languages like
Arabic or Hebrew, this will be the right side.
Basic usage:
assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
@@ -888,36 +922,36 @@ Arabic or Hebrew, this will be the right side.
let x: &[_] = &['1', '2'];
assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
Returns a string slice with the prefix removed.
+Returns a string slice with the prefix removed.
If the string starts with the pattern prefix
, returns substring after the prefix, wrapped
in Some
. Unlike trim_start_matches
, this method removes the prefix exactly once.
If the string does not start with prefix
, returns None
.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
assert_eq!("foo:bar".strip_prefix("bar"), None);
assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
Returns a string slice with the suffix removed.
+Returns a string slice with the suffix removed.
If the string ends with the pattern suffix
, returns the substring before the suffix,
wrapped in Some
. Unlike trim_end_matches
, this method removes the suffix exactly once.
If the string does not end with suffix
, returns None
.
The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
assert_eq!("bar:foo".strip_suffix("bar"), None);
assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
Returns a string slice with all suffixes that match a pattern +
Returns a string slice with all suffixes that match a pattern repeatedly removed.
-The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
A string is a sequence of bytes. end
in this context means the last
position of that byte string; for a left-to-right language like English or
Russian, this will be right side, and for right-to-left languages like
Arabic or Hebrew, this will be the left side.
Simple patterns:
assert_eq!("11foo1bar11".trim_end_matches('1'), "11foo1bar");
@@ -928,17 +962,17 @@ Arabic or Hebrew, this will be the left side.
A more complex pattern, using a closure:
assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
-
superseded by trim_start_matches
superseded by trim_start_matches
Returns a string slice with all prefixes that match a pattern repeatedly removed.
-The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
A string is a sequence of bytes. ‘Left’ in this context means the first position of that byte string; for a language like Arabic or Hebrew which are ‘right to left’ rather than ‘left to right’, this will be the right side, not the left.
-Basic usage:
assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
@@ -946,17 +980,17 @@ the right side, not the left.
let x: &[_] = &['1', '2'];
assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
superseded by trim_end_matches
superseded by trim_end_matches
Returns a string slice with all suffixes that match a pattern repeatedly removed.
-The pattern can be a &str
, char
, a slice of char
s, or a
+
The pattern can be a &str
, char
, a slice of char
s, or a
function or closure that determines if a character matches.
A string is a sequence of bytes. ‘Right’ in this context means the last position of that byte string; for a language like Arabic or Hebrew which are ‘right to left’ rather than ‘left to right’, this will be the left side, not the right.
-Simple patterns:
assert_eq!("11foo1bar11".trim_right_matches('1'), "11foo1bar");
@@ -967,17 +1001,17 @@ the left side, not the right.
A more complex pattern, using a closure:
assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
-
Parses this string slice into another type.
+Parses this string slice into another type.
Because parse
is so general, it can cause problems with type
inference. As such, parse
is one of the few times you’ll see
the syntax affectionately known as the ‘turbofish’: ::<>
. This
helps the inference algorithm understand specifically which type
you’re trying to parse into.
parse
can parse into any type that implements the FromStr
trait.
Will return Err
if it’s not possible to parse this string slice into
+
parse
can parse into any type that implements the FromStr
trait.
Will return Err
if it’s not possible to parse this string slice into
the desired type.
Basic usage
let four: u32 = "4".parse().unwrap();
@@ -993,24 +1027,24 @@ the desired type.
let nope = "j".parse::<u32>();
assert!(nope.is_err());
-
Checks if all characters in this string are within the ASCII range.
-Checks if all characters in this string are within the ASCII range.
+let ascii = "hello!\n";
let non_ascii = "Grüße, Jürgen ❤";
assert!(ascii.is_ascii());
assert!(!non_ascii.is_ascii());
Checks that two strings are an ASCII case-insensitive match.
+Checks that two strings are an ASCII case-insensitive match.
Same as to_ascii_lowercase(a) == to_ascii_lowercase(b)
,
but without allocating and copying temporaries.
assert!("Ferris".eq_ignore_ascii_case("FERRIS"));
assert!("Ferrös".eq_ignore_ascii_case("FERRöS"));
assert!(!"Ferrös".eq_ignore_ascii_case("FERRÖS"));
Return an iterator that escapes each char in self
with char::escape_debug
.
Return an iterator that escapes each char in self
with char::escape_debug
.
Note: only extended grapheme codepoints that begin the string will be escaped.
-As an iterator:
for c in "❤\n!".escape_debug() {
@@ -1026,8 +1060,8 @@ escaped.
Using to_string
:
assert_eq!("❤\n!".escape_debug().to_string(), "❤\\n!");
-
Return an iterator that escapes each char in self
with char::escape_default
.
Return an iterator that escapes each char in self
with char::escape_default
.
As an iterator:
for c in "❤\n!".escape_default() {
@@ -1043,8 +1077,8 @@ escaped.
Using to_string
:
assert_eq!("❤\n!".escape_default().to_string(), "\\u{2764}\\n!");
-
Return an iterator that escapes each char in self
with char::escape_unicode
.
Return an iterator that escapes each char in self
with char::escape_unicode
.
As an iterator:
for c in "❤\n!".escape_unicode() {
@@ -1060,11 +1094,11 @@ escaped.
Using to_string
:
assert_eq!("❤\n!".escape_unicode().to_string(), "\\u{2764}\\u{a}\\u{21}");
-
Replaces all matches of a pattern with another string.
+replace
creates a new String
, and copies the data from this string slice into it.
While doing so, it attempts to find matches of a pattern. If it finds any, it
replaces them with the replacement string slice.
Basic usage:
let s = "this is old";
@@ -1074,11 +1108,11 @@ replaces them with the replacement string slice.
let s = "this is old";
assert_eq!(s, s.replace("cookie monster", "little lamb"));
-
Replaces first N matches of a pattern with another string.
-replacen
creates a new String
, and copies the data from this string slice into it.
+
Replaces first N matches of a pattern with another string.
+replacen
creates a new String
, and copies the data from this string slice into it.
While doing so, it attempts to find matches of a pattern. If it finds any, it
replaces them with the replacement string slice at most count
times.
Basic usage:
let s = "foo foo 123 foo";
@@ -1089,13 +1123,13 @@ replaces them with the replacement string slice at most count
times
let s = "this is old";
assert_eq!(s, s.replacen("cookie monster", "little lamb", 10));
-
Returns the lowercase equivalent of this string slice, as a new String
.
Returns the lowercase equivalent of this string slice, as a new String
.
‘Lowercase’ is defined according to the terms of the Unicode Derived Core Property
Lowercase
.
Since some characters can expand into multiple characters when changing
-the case, this function returns a String
instead of modifying the
+the case, this function returns a String
instead of modifying the
parameter in-place.
Basic usage:
let s = "HELLO";
@@ -1116,13 +1150,13 @@ parameter in-place.
let new_year = "农历新年";
assert_eq!(new_year, new_year.to_lowercase());
-
Returns the uppercase equivalent of this string slice, as a new String
.
Returns the uppercase equivalent of this string slice, as a new String
.
‘Uppercase’ is defined according to the terms of the Unicode Derived Core Property
Uppercase
.
Since some characters can expand into multiple characters when changing
-the case, this function returns a String
instead of modifying the
+the case, this function returns a String
instead of modifying the
parameter in-place.
Basic usage:
let s = "hello";
@@ -1138,10 +1172,10 @@ parameter in-place.
let s = "tschüß";
assert_eq!("TSCHÜSS", s.to_uppercase());
-
Creates a new String
by repeating a string n
times.
This function will panic if the capacity would overflow.
-Basic usage:
assert_eq!("abc".repeat(4), String::from("abcabcabcabc"));
// this will panic at runtime
let huge = "0123456789abcdef".repeat(usize::MAX);
Returns a copy of this string where each character is mapped to its +
Returns a copy of this string where each character is mapped to its ASCII upper case equivalent.
ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.
-To uppercase the value in-place, use make_ascii_uppercase
.
To uppercase the value in-place, use make_ascii_uppercase
.
To uppercase ASCII characters in addition to non-ASCII characters, use
to_uppercase
.
let s = "Grüße, Jürgen ❤";
assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase());
Returns a copy of this string where each character is mapped to its +
Returns a copy of this string where each character is mapped to its ASCII lower case equivalent.
ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.
-To lowercase the value in-place, use make_ascii_lowercase
.
To lowercase the value in-place, use make_ascii_lowercase
.
To lowercase ASCII characters in addition to non-ASCII characters, use
to_lowercase
.
let s = "Grüße, Jürgen ❤";
assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase());
Mutably borrows from an owned value. Read more
-Attaches the provided Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
Mutably borrows from an owned value. Read more
+Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub struct favicons;
Mutably borrows from an owned value. Read more
-Attaches the provided Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
pub struct favicons;
Mutably borrows from an owned value. Read more
+Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub struct serve_index;
Mutably borrows from an owned value. Read more
-Attaches the provided Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
pub struct serve_index;
Mutably borrows from an owned value. Read more
+Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub struct static_files;
Mutably borrows from an owned value. Read more
-Attaches the provided Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
-WithDispatch
wrapper. Read more
pub struct static_files;
Mutably borrows from an owned value. Read more
+Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub const CACHE_BUSTER_DATA_FILE: &str = "./src/cache_buster_data.json";
file to which filemap is written during compilation +
pub const CACHE_BUSTER_DATA_FILE: &str = "./src/cache_buster_data.json";
file to which filemap is written during compilation
include this to .gitignore
Module describing runtime compoenet for fetching modified filenames
+Module describing runtime compoenet for fetching modified filenames
Add the following tou your program to load the filemap during compiletime:
use cache_buster::Files;
@@ -8,5 +13,5 @@
let files = Files::new(CACHE_BUSTER_DATA_FILE);
Filemap struct
-pub struct Files { /* fields omitted */ }
Filemap struct
+pub struct Files { /* private fields */ }
Filemap struct
maps original names to generated names
-Load filemap in main program. Should be called from main program
-Load filemap in main program. Should be called from main program
+Deserialize this value from the given Serde deserializer. Read more
-Mutably borrows from an owned value. Read more
-Deserialize this value from the given Serde deserializer. Read more
+Mutably borrows from an owned value. Read more
+The resulting type after obtaining ownership.
+Creates owned data from borrowed data, usually by cloning. Read more
+toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
+To optimise network load time, browsers cache static files. Caching greatly improves performance but how do you inform browsers to invalidate cache when your files have changed?
@@ -11,7 +16,7 @@ by changing file names to include the hash of the files’ contents. as, because of the file names changing, the path to the filename, too, will change. So as far as the browser is concerned, you are trying to load a file that it doesn’t have. Pretty neat, isn’t it? -build.rs
file to which filemap is written during compilation
include this to .gitignore
#[non_exhaustive]
+BusterBuilderError in cache_buster::processor - Rust
+
+
+ Enum cache_buster::processor::BusterBuilderError
source · [−]#[non_exhaustive]
pub enum BusterBuilderError {
- UninitializedField(&'static str),
- ValidationError(String),
+ UninitializedField(&'static str),
+ ValidationError(String),
}
Expand description
Error type for BusterBuilder
-Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.UninitializedField(&'static str)
Tuple Fields
0: &'static str
Uninitialized field
-ValidationError(String)
Tuple Fields
0: String
Custom validation error
-Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BusterBuilderError
impl Send for BusterBuilderError
impl Sync for BusterBuilderError
impl Unpin for BusterBuilderError
impl UnwindSafe for BusterBuilderError
Blanket Implementations
+Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.UninitializedField(&'static str)
Uninitialized field
+ValidationError(String)
Custom validation error
+Trait Implementations
sourceimpl Debug for BusterBuilderError
sourceimpl Display for BusterBuilderError
sourceimpl Error for BusterBuilderError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
+sourcefn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
+1.0.0 · sourcefn description(&self) -> &str
👎 Deprecated since 1.42.0: use the Display impl or to_string()
+sourceimpl From<String> for BusterBuilderError
sourceimpl From<UninitializedFieldError> for BusterBuilderError
Auto Trait Implementations
impl RefUnwindSafe for BusterBuilderError
impl Send for BusterBuilderError
impl Sync for BusterBuilderError
impl Unpin for BusterBuilderError
impl UnwindSafe for BusterBuilderError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
+
pub enum NoHashCategory<'a> {
- FileExtentions(Vec<&'a str>),
- FilePaths(Vec<&'a str>),
+NoHashCategory in cache_buster::processor - Rust
+
+
+ Enum cache_buster::processor::NoHashCategory
source · [−]Expand description
Items to avoid hash calculation.
This is useful when serving vendor static files which are interlinked, where chaing
file names should mean changing how the vendor files pulls its dependencies — which are
@@ -11,23 +16,25 @@ beyond the abilities of cache_buster
.
let extensions = NoHashCategory::FileExtentions(vec!["wasm"]);
let files = NoHashCategory::FileExtentions(vec!["swagger-ui-bundle.js", "favicon-16x16.png"]);
- Variants
FileExtentions(Vec<&'a str>)
vector of file extensions that should be avoided for hash processing
-FilePaths(Vec<&'a str>)
list of file paths that should be avoided for file processing
-Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for NoHashCategory<'a>
impl<'a> Send for NoHashCategory<'a>
impl<'a> Sync for NoHashCategory<'a>
impl<'a> Unpin for NoHashCategory<'a>
impl<'a> UnwindSafe for NoHashCategory<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
-
+
FileExtentions(Vec<&'a str>)
vector of file extensions that should be avoided for hash processing
+FilePaths(Vec<&'a str>)
list of file paths that should be avoided for file processing
+Returns a copy of the value. Read more
+Performs copy-assignment from source
. Read more
Mutably borrows from an owned value. Read more
+The resulting type after obtaining ownership.
+Creates owned data from borrowed data, usually by cloning. Read more
+toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
+Module describing file processor that changes filenames to setup cache-busting
+Module describing file processor that changes filenames to setup cache-busting
Run the following during build using build.rs
:
use cache_buster::BusterBuilder;
@@ -30,5 +35,5 @@ filenames from within your program. See [Files]
Error type for BusterBuilder
Items to avoid hash calculation.
-pub struct Buster<'a> { /* fields omitted */ }
Configuration for setting up cache-busting
-Processes files.
+pub struct Buster<'a> { /* private fields */ }
Configuration for setting up cache-busting
+Mutably borrows from an owned value. Read more
-Mutably borrows from an owned value. Read more
+The resulting type after obtaining ownership.
+Creates owned data from borrowed data, usually by cloning. Read more
+toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
+pub struct BusterBuilder<'a> { /* fields omitted */ }
Builder for Buster
.
mime_types for hashing
-directory for writing results
-follow symlinks?
-exclude these files for hashing. +
pub struct BusterBuilder<'a> { /* private fields */ }
Builder for Buster
.
mime_types for hashing
+directory for writing results
+follow symlinks?
+exclude these files for hashing. They will be copied over without including a hash in the filename Path should be relative to [self.source]
-Mutably borrows from an owned value. Read more
-Returns a copy of the value. Read more
+Performs copy-assignment from source
. Read more
Mutably borrows from an owned value. Read more
+The resulting type after obtaining ownership.
+Creates owned data from borrowed data, usually by cloning. Read more
+toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
+fn:
) to \
restrict the search to a given item kind.","Accepted kinds are: fn
, mod
, struct
, \
enum
, trait
, type
, macro
, \
and const
.","Search functions by type signature (e.g., vec -> usize
or \
* -> vec
)","Search multiple things at once by splitting your query with comma (e.g., \
str,u8
or String,struct:Vec,test
)","You can look for items with an exact name by putting double quotes around \
- your request: \"string\"
","Look for items inside another one by searching for a path: vec::Vec
",].map(function(x){return""+x+"
"}).join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="\"string\"
","Look for items inside another one by searching for a path: vec::Vec
",].map(function(x){return""+x+"
"}).join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="Buster
.","Error type for BusterBuilder","vector of file extensions that should be avoided for hash …","list of file paths that should be avoided for file …","Items to avoid hash calculation.","Uninitialized field","Custom validation error","","","","","","","","","Builds a new Buster
.","","","","","","","","","","","","follow symlinks?","","","","","","","","","","","mime_types for hashing","exclude these files for hashing. They will be copied over …","route prefixes","Processes files.","directory for writing results","source directory","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,2,2,0,3,3,2,4,3,5,2,4,3,5,4,2,4,5,2,4,5,4,2,3,3,5,4,2,4,3,3,3,5,2,4,3,5,4,4,4,5,4,4,2,4,5,3,2,4,3,5,2,4,3,5,2,4,3,5,6,7,8,9],"f":[null,null,null,null,[[]],[[]],[[],["files",3]],[[]],[[],["result",4]],[[["files",3]],["bool",15]],[[["formatter",3]],["result",6]],[[]],[[],["option",4,[["str",15]]]],[[],["option",4,[["string",3]]]],[[]],[[["files",3]],["bool",15]],[[["str",15]]],[[],["result",4]],[[]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],null,null,null,null,null,null,null,null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["result",4,[["buster",3],["busterbuildererror",4]]]],[[],["nohashcategory",4]],[[],["busterbuilder",3]],[[],["buster",3]],[[]],[[]],[[]],[[]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["formatter",3]],["result",6]],[[["bool",15]]],[[]],[[]],[[["string",3]]],[[]],[[["uninitializedfielderror",3]]],[[]],[[]],[[]],[[]],[[]],[[["into",8,[["vec",3,[["mime",3]]]]]]],[[["vec",3,[["nohashcategory",4]]]]],[[["into",8,[["string",3]]]]],[[],["result",4,[["error",3]]]],[[["into",8,[["string",3]]]]],[[["into",8,[["string",3]]]]],[[]],[[]],[[]],[[],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],[[],["typeid",3]],null,null,null,null],"p":[[3,"Files"],[4,"NoHashCategory"],[4,"BusterBuilderError"],[3,"BusterBuilder"],[3,"Buster"],[13,"UninitializedField"],[13,"ValidationError"],[13,"FileExtentions"],[13,"FilePaths"]]}\
+"actix_web":{"doc":"","t":[3,17,3,3,3,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,11,11,11,11,11,11,11,11,11,11,11,5,5,0,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,3,5,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5],"n":["Asset","CACHE_AGE","FILES","Favicons","INDEX","__private_field","__private_field","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","deref","deref","favicons","from","from","from","from","from","from","from","get","get","get","get","handle_assets","handle_favicons","index","into","into","into","into","into","into","into","iter","iter","iter","iter","main","register","register","register","serve_index","services","static_files","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","get_index"],"q":["actix_web","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web::index"],"d":["Embed files. Or not. You can also read files dynamically","Set a riddicolusly high cache age","create filemap","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Get an embedded file and its metadata.","","","Get an embedded file and its metadata.","","","","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","","Iterates over the file paths in the folder.","","Iterates over the file paths in the folder.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,1,2,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,0,1,2,3,4,5,6,7,3,3,6,6,0,0,0,1,2,3,4,5,6,7,3,3,6,6,0,4,5,7,0,0,0,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,0],"f":[null,null,null,null,null,null,null,[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["files",3]],[[["",0]],["string",3]],null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["str",0]],["option",4,[["embeddedfile",3]]]],[[["str",0]],["option",4,[["embeddedfile",3]]]],[[["str",0]],["option",4,[["embeddedfile",3]]]],[[["str",0]],["option",4,[["embeddedfile",3]]]],[[["str",0]],["httpresponse",3]],[[["str",0]],["httpresponse",3]],null,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["filenames",4]],[[]],[[],["filenames",4]],[[]],[[],["result",6]],[[["appservice",3]]],[[["appservice",3]]],[[["appservice",3]]],null,[[["serviceconfig",3]]],null,[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],["string",3]]],"p":[[3,"FILES"],[3,"INDEX"],[3,"Asset"],[3,"static_files"],[3,"serve_index"],[3,"Favicons"],[3,"favicons"]]},\
+"cache_buster":{"doc":"What is cache busting?","t":[17,0,0,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,4,13,13,4,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12],"n":["CACHE_BUSTER_DATA_FILE","filemap","processor","Files","borrow","borrow_mut","clone","clone_into","deserialize","eq","fmt","from","get","get_full_path","into","ne","new","serialize","to_owned","try_from","try_into","type_id","Buster","BusterBuilder","BusterBuilderError","FileExtentions","FilePaths","NoHashCategory","UninitializedField","ValidationError","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone_into","clone_into","clone_into","default","fmt","fmt","fmt","fmt","follow_links","from","from","from","from","from","from","into","into","into","into","mime_types","no_hash","prefix","process","result","source","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","0","0","0","0"],"q":["cache_buster","","","cache_buster::filemap","","","","","","","","","","","","","","","","","","","cache_buster::processor","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","cache_buster::processor::BusterBuilderError","","cache_buster::processor::NoHashCategory",""],"d":["file to which filemap is written during compilation …","Module describing runtime compoenet for fetching modified …","Module describing file processor that changes filenames to …","Filemap struct","","","","","","","","Returns the argument unchanged.","Get relative file path","Get file path","Calls U::from(self)
.","","Load filemap in main program. Should be called from main …","","","","","","Configuration for setting up cache-busting","Builder for Buster
.","Error type for BusterBuilder","vector of file extensions that should be avoided for hash …","list of file paths that should be avoided for file …","Items to avoid hash calculation.","Uninitialized field","Custom validation error","","","","","","","","","Builds a new Buster
.","","","","","","","","","","","","follow symlinks?","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","mime_types for hashing","exclude these files for hashing. They will be copied over …","route prefixes","Processes files.","directory for writing results","source directory","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,2,2,0,3,3,2,4,3,5,2,4,3,5,4,2,4,5,2,4,5,4,2,3,3,5,4,2,4,3,3,3,5,2,4,3,5,4,4,4,5,4,4,2,4,5,3,2,4,3,5,2,4,3,5,2,4,3,5,6,7,8,9],"f":[null,null,null,null,[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["files",3]],[[["",0],["",0]]],[[],["result",4]],[[["",0],["files",3]],["bool",0]],[[["",0],["formatter",3]],["result",6]],[[]],[[["",0]],["option",4,[["str",0]]]],[[["",0]],["option",4,[["string",3]]]],[[]],[[["",0],["files",3]],["bool",0]],[[["str",0]]],[[["",0]],["result",4]],[[["",0]]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],null,null,null,null,null,null,null,null,[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["result",4,[["buster",3],["busterbuildererror",4]]]],[[["",0]],["nohashcategory",4]],[[["",0]],["busterbuilder",3]],[[["",0]],["buster",3]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["",0]]],[[]],[[["",0],["formatter",3]],["result",6]],[[["",0],["formatter",3]],["result",6]],[[["",0],["formatter",3]],["result",6]],[[["",0],["formatter",3]],["result",6]],[[["",0],["bool",0]],["",0]],[[]],[[]],[[["uninitializedfielderror",3]]],[[]],[[["string",3]]],[[]],[[]],[[]],[[]],[[]],[[["",0],["into",8,[["vec",3,[["mime",3]]]]]],["",0]],[[["",0],["vec",3,[["nohashcategory",4]]]],["",0]],[[["",0],["into",8,[["string",3]]]],["",0]],[[["",0]],["result",4,[["error",3]]]],[[["",0],["into",8,[["string",3]]]],["",0]],[[["",0],["into",8,[["string",3]]]],["",0]],[[["",0]]],[[["",0]]],[[["",0]]],[[["",0]],["string",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],null,null,null,null],"p":[[3,"Files"],[4,"NoHashCategory"],[4,"BusterBuilderError"],[3,"BusterBuilder"],[3,"Buster"],[13,"UninitializedField"],[13,"ValidationError"],[13,"FileExtentions"],[13,"FilePaths"]]}\
}');
if (window.initSearch) {window.initSearch(searchIndex)};
\ No newline at end of file
diff --git a/search.js b/search.js
index 6f612fa..a8026db 100644
--- a/search.js
+++ b/search.js
@@ -1 +1,2 @@
-(function(){var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias"];var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");function printTab(nb){if(nb===0||nb===1||nb===2){searchState.currentTab=nb}var nb_copy=nb;onEachLazy(document.getElementById("titles").childNodes,function(elem){if(nb_copy===0){addClass(elem,"selected")}else{removeClass(elem,"selected")}nb_copy-=1});onEachLazy(document.getElementById("results").childNodes,function(elem){if(nb===0){addClass(elem,"active")}else{removeClass(elem,"active")}nb-=1})}function removeEmptyStringsFromArray(x){for(var i=0,len=x.length;i1 +index.rs - source + +\ No newline at end of file diff --git a/src/actix_web/main.rs.html b/src/actix_web/main.rs.html index aac27a3..9c37949 100644 --- a/src/actix_web/main.rs.html +++ b/src/actix_web/main.rs.html @@ -1,5 +1,9 @@ - main.rs - source - 1 +main.rs - source + +\ No newline at end of file diff --git a/src/cache_buster/filemap.rs.html b/src/cache_buster/filemap.rs.html index aff8868..767d4ef 100644 --- a/src/cache_buster/filemap.rs.html +++ b/src/cache_buster/filemap.rs.html @@ -1,5 +1,9 @@ - filemap.rs - source - 1 +filemap.rs - source + +\ No newline at end of file diff --git a/src/cache_buster/lib.rs.html b/src/cache_buster/lib.rs.html index e5c6bee..29e2bf1 100644 --- a/src/cache_buster/lib.rs.html +++ b/src/cache_buster/lib.rs.html @@ -1,5 +1,9 @@ - lib.rs - source - 1 +lib.rs - source + +\ No newline at end of file diff --git a/src/cache_buster/processor.rs.html b/src/cache_buster/processor.rs.html index 9193899..c3c6d50 100644 --- a/src/cache_buster/processor.rs.html +++ b/src/cache_buster/processor.rs.html @@ -1,5 +1,9 @@ - processor.rs - source - 1 +processor.rs - source + +\ No newline at end of file diff --git a/storage.js b/storage.js index 6b16cbd..c6d070d 100644 --- a/storage.js +++ b/storage.js @@ -1 +1 @@ -var resourcesSuffix="";var darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue('rustdoc-'+settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed){for(i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(i=0;i =0){updateLocalStorage("rustdoc-preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)} \ No newline at end of file +var darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue(settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed){for(i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(i=0;i =0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchToSavedTheme()}window.addEventListener("pageshow",function(ev){if(ev.persisted){setTimeout(switchToSavedTheme,0)}}) \ No newline at end of file