pub struct IdMismatch<T: Identifier> {
pub cell: T,
pub token: T,
}Expand description
The comparison error for runtime tokens.
Such an error being returned implies a massive bug in the calling code, as it implies that
said code failed to track which instance of a [runtime_token] was used to construct a cell,
and thus failed to ensure that the token was used correctly.
Unless the token is backed by an integer with sufficient size to guarantee that the program never constructs multiple tokens with a same identifier, your program SHOULD NOT rely on token identifiers being unique for soundness.
Fields§
§cell: TThe identifier of the token the cell was expecting.
token: TThe identifier of the token that was used to attempt accessing the cell’s contents.
Trait Implementations§
Source§impl<T: Clone + Identifier> Clone for IdMismatch<T>
impl<T: Clone + Identifier> Clone for IdMismatch<T>
Source§fn clone(&self) -> IdMismatch<T>
fn clone(&self) -> IdMismatch<T>
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<T: Debug + Identifier> Debug for IdMismatch<T>
impl<T: Debug + Identifier> Debug for IdMismatch<T>
Source§impl<T: Identifier> Display for IdMismatch<T>
impl<T: Identifier> Display for IdMismatch<T>
Source§impl<T: Identifier> Error for IdMismatch<T>
impl<T: Identifier> Error for IdMismatch<T>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl<T: Copy + Identifier> Copy for IdMismatch<T>
Auto Trait Implementations§
impl<T> Freeze for IdMismatch<T>where
T: Freeze,
impl<T> RefUnwindSafe for IdMismatch<T>where
T: RefUnwindSafe,
impl<T> Send for IdMismatch<T>
impl<T> Sync for IdMismatch<T>
impl<T> Unpin for IdMismatch<T>where
T: Unpin,
impl<T> UnsafeUnpin for IdMismatch<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for IdMismatch<T>where
T: UnwindSafe,
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