pub struct PlanCacheKey { /* private fields */ }Expand description
Identifies a cached plan evaluation by the content ids of its request and plan.
Two evaluations collide in the plan cache only when both the request and the
plan hash to the same ContentId, so the same plan run against different
requests (or different plans for the same request) stay distinct entries.
Implementations§
Source§impl PlanCacheKey
impl PlanCacheKey
Sourcepub fn new(request_content_id: ContentId, plan_content_id: ContentId) -> Self
pub fn new(request_content_id: ContentId, plan_content_id: ContentId) -> Self
Returns a key built directly from precomputed request and plan content ids.
Sourcepub fn for_request_plan(request: &Expr, plan: &Expr) -> Result<Self>
pub fn for_request_plan(request: &Expr, plan: &Expr) -> Result<Self>
Returns the key derived by hashing the request and plan expressions.
Sourcepub fn request_content_id(&self) -> &ContentId
pub fn request_content_id(&self) -> &ContentId
Returns the content id of the request portion of the key.
Sourcepub fn plan_content_id(&self) -> &ContentId
pub fn plan_content_id(&self) -> &ContentId
Returns the content id of the plan portion of the key.
Trait Implementations§
Source§impl Clone for PlanCacheKey
impl Clone for PlanCacheKey
Source§fn clone(&self) -> PlanCacheKey
fn clone(&self) -> PlanCacheKey
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 moreSource§impl Debug for PlanCacheKey
impl Debug for PlanCacheKey
impl Eq for PlanCacheKey
Source§impl Ord for PlanCacheKey
impl Ord for PlanCacheKey
Source§fn cmp(&self, other: &PlanCacheKey) -> Ordering
fn cmp(&self, other: &PlanCacheKey) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PlanCacheKey
impl PartialEq for PlanCacheKey
Source§fn eq(&self, other: &PlanCacheKey) -> bool
fn eq(&self, other: &PlanCacheKey) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PlanCacheKey
impl PartialOrd for PlanCacheKey
impl StructuralPartialEq for PlanCacheKey
Auto Trait Implementations§
impl Freeze for PlanCacheKey
impl RefUnwindSafe for PlanCacheKey
impl Send for PlanCacheKey
impl Sync for PlanCacheKey
impl Unpin for PlanCacheKey
impl UnsafeUnpin for PlanCacheKey
impl UnwindSafe for PlanCacheKey
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