pub struct HeaderOptions {
pub browsers: Vec<Browser>,
pub os: Vec<String>,
pub devices: Vec<String>,
pub locales: Vec<String>,
pub http_version: HttpVersion,
pub strict: bool,
}Expand description
The options of a HeaderGenerator, defaulting as browserforge does:
every supported browser, operating system and device, en-US, HTTP/2,
not strict.
Fields§
§browsers: Vec<Browser>The browsers to draw from; each carries its own HTTP version.
os: Vec<String>The operating systems to draw from.
devices: Vec<String>The devices to draw from.
locales: Vec<String>The Accept-Language locales, most preferred first; at most
MAX_LOCALES.
http_version: HttpVersionThe requested HTTP version. HTTP/1 falls back to HTTP/2 when no HTTP/1 sample fits.
strict: boolFail instead of relaxing the options when no sample fits them.
Implementations§
Source§impl HeaderOptions
impl HeaderOptions
Sourcepub fn with_http_version(self, http_version: HttpVersion) -> Self
pub fn with_http_version(self, http_version: HttpVersion) -> Self
Sets the requested HTTP version and that of every browser, as
browserforge’s http_version argument does for browsers given by
name.
Trait Implementations§
Source§impl Clone for HeaderOptions
impl Clone for HeaderOptions
Source§impl Debug for HeaderOptions
impl Debug for HeaderOptions
Source§impl Default for HeaderOptions
impl Default for HeaderOptions
impl Eq for HeaderOptions
Source§impl PartialEq for HeaderOptions
impl PartialEq for HeaderOptions
impl StructuralPartialEq for HeaderOptions
Auto Trait Implementations§
impl Freeze for HeaderOptions
impl RefUnwindSafe for HeaderOptions
impl Send for HeaderOptions
impl Sync for HeaderOptions
impl Unpin for HeaderOptions
impl UnsafeUnpin for HeaderOptions
impl UnwindSafe for HeaderOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.