#[non_exhaustive]pub struct RouteInput<'a> {
pub url: &'a Url,
pub need: DeclaredNeed,
pub pins: CallerPins<'a>,
pub memory: Option<&'a SiteMemory>,
pub hour: Option<u8>,
}Expand description
One request, as the router sees it.
The url arrives parsed. Parsing allocates and routing does not, so the caller pays that cost once where it already has to.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.url: &'a UrlThe address to fetch.
need: DeclaredNeedWhat the caller wants back.
pins: CallerPins<'a>Settings the caller fixed itself.
memory: Option<&'a SiteMemory>What the caller remembers about this site, when it remembers anything.
hour: Option<u8>The hour of the day at the caller, from zero to twenty three.
Refusal rates move with the clock, and two floats is a cheap way to say so. This crate reads no clock of its own: a caller that cares sets it, and a caller that does not gets the unknown slot.
Implementations§
Source§impl<'a> RouteInput<'a>
impl<'a> RouteInput<'a>
Sourcepub const fn new(url: &'a Url, need: DeclaredNeed) -> RouteInput<'a>
pub const fn new(url: &'a Url, need: DeclaredNeed) -> RouteInput<'a>
A request with nothing fixed and nothing remembered.
Sourcepub const fn with_pins(self, pins: CallerPins<'a>) -> RouteInput<'a>
pub const fn with_pins(self, pins: CallerPins<'a>) -> RouteInput<'a>
Fix some settings.
Sourcepub const fn with_memory(self, memory: &'a SiteMemory) -> RouteInput<'a>
pub const fn with_memory(self, memory: &'a SiteMemory) -> RouteInput<'a>
Supply what the caller remembers about this site.
Sourcepub const fn at_hour(self, hour: u8) -> RouteInput<'a>
pub const fn at_hour(self, hour: u8) -> RouteInput<'a>
Say what time it is where the caller is.
Trait Implementations§
Source§impl<'a> Clone for RouteInput<'a>
impl<'a> Clone for RouteInput<'a>
Source§fn clone(&self) -> RouteInput<'a>
fn clone(&self) -> RouteInput<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for RouteInput<'a>
Source§impl<'a> Debug for RouteInput<'a>
impl<'a> Debug for RouteInput<'a>
Source§impl<'a> PartialEq for RouteInput<'a>
impl<'a> PartialEq for RouteInput<'a>
impl<'a> StructuralPartialEq for RouteInput<'a>
Auto Trait Implementations§
impl<'a> Forget for RouteInput<'a>
impl<'a> Freeze for RouteInput<'a>
impl<'a> Move for RouteInput<'a>
impl<'a> RefUnwindSafe for RouteInput<'a>
impl<'a> Send for RouteInput<'a>
impl<'a> Sync for RouteInput<'a>
impl<'a> Unpin for RouteInput<'a>
impl<'a> UnsafeUnpin for RouteInput<'a>
impl<'a> UnwindSafe for RouteInput<'a>
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