pub struct Link { /* private fields */ }Expand description
A link to follow with Queue::follow.
A link is either an href, absolute or relative to the page it was found
on, or a complete Seed. Strings, URIs and seeds convert into links.
use spire_core::frontier::queue::Link;
let next = Link::from("/page/2");
let detail = Link::from("../items/42").with_tag("item");
let next = Link::from("/page/3").with_priority(10);Implementations§
Source§impl Link
impl Link
Sourcepub fn with_tag(self, tag: impl Into<Tag>) -> Self
pub fn with_tag(self, tag: impl Into<Tag>) -> Self
Routes the followed request to the handler for tag.
Sourcepub const fn with_priority(self, priority: i32) -> Self
pub const fn with_priority(self, priority: i32) -> Self
Sets the followed request’s priority, e.g. scored from the page the link was found on; frontiers that order by priority crawl higher priorities first. A scoring frontier adds its score to it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnsafeUnpin for Link
impl UnwindSafe for Link
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