Struct robotxt::GroupBuilder
source · 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 copy 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 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