pub struct GroupBuilder { /* private fields */ }Available on crate feature
builder only.Expand description
The single formatted user-agent group.
Implementations§
Source§impl GroupBuilder
impl GroupBuilder
Sourcepub fn header(self, header: &str) -> Self
pub fn header(self, header: &str) -> Self
Adds a local header, usually used for rule notes.
use robotxt::RobotsBuilder;
let txt = RobotsBuilder::default()
.group(["*"], |u| u.allow("/"))
.group(["foobot"], |u| {
u.header("Note: Bad Bot!")
.disallow("/")
.allow("/bad/bot.txt")
});Sourcepub fn allow(self, rule: &str) -> Self
pub fn allow(self, rule: &str) -> Self
Adds an Allow directive.
use robotxt::RobotsBuilder;
let txt = RobotsBuilder::default()
.group(["foobot"], |u| {
u.allow("/").disallow("/secret.txt")
});Sourcepub fn disallow(self, rule: &str) -> Self
pub fn disallow(self, rule: &str) -> Self
Adds a Disallow directive.
use robotxt::RobotsBuilder;
let txt = RobotsBuilder::default()
.group(["foobot"], |u| {
u.allow("/").disallow("/secret.txt")
});Sourcepub fn crawl_delay(self, delay: u16) -> Self
pub fn crawl_delay(self, delay: u16) -> Self
Adds a Crawl-Delay directive.
use robotxt::RobotsBuilder;
let txt = RobotsBuilder::default()
.group(["foobot"], |u| {
u.crawl_delay(5)
});Adds a local footer, usually used for rule notes.
use robotxt::RobotsBuilder;
let txt = RobotsBuilder::default()
.group(["foobot"], |u| {
u.footer("Note: Bad Bot!")
.disallow("/")
.allow("/bad/bot.txt")
});Trait Implementations§
Source§impl Clone for GroupBuilder
impl Clone for GroupBuilder
Source§fn clone(&self) -> GroupBuilder
fn clone(&self) -> GroupBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GroupBuilder
impl Debug for GroupBuilder
Source§impl Default for GroupBuilder
impl Default for GroupBuilder
Source§fn default() -> GroupBuilder
fn default() -> GroupBuilder
Returns the “default value” for a type. Read more
Source§impl Display for GroupBuilder
impl Display for GroupBuilder
Source§impl<'ua> FromIterator<&'ua str> for GroupBuilder
impl<'ua> FromIterator<&'ua str> for GroupBuilder
Auto Trait Implementations§
impl Freeze for GroupBuilder
impl RefUnwindSafe for GroupBuilder
impl Send for GroupBuilder
impl Sync for GroupBuilder
impl Unpin for GroupBuilder
impl UnwindSafe for GroupBuilder
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