pub struct ParseContext<'a> {
pub now: CmrTimestamp,
pub recipient_address: Option<&'a str>,
pub max_message_bytes: usize,
pub max_header_ids: usize,
}Expand description
Parse-time validation context.
Fields§
§now: CmrTimestamp“Current time” used for future timestamp checks.
recipient_address: Option<&'a str>Recipient address; if present, this address cannot appear in the header.
max_message_bytes: usizeMaximum allowed message byte length.
max_header_ids: usizeMaximum allowed header entries.
Implementations§
Source§impl<'a> ParseContext<'a>
impl<'a> ParseContext<'a>
Sourcepub fn secure(now: CmrTimestamp, recipient_address: Option<&'a str>) -> Self
pub fn secure(now: CmrTimestamp, recipient_address: Option<&'a str>) -> Self
Creates a context with secure defaults.
Trait Implementations§
Source§impl<'a> Clone for ParseContext<'a>
impl<'a> Clone for ParseContext<'a>
Source§fn clone(&self) -> ParseContext<'a>
fn clone(&self) -> ParseContext<'a>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<'a> Freeze for ParseContext<'a>
impl<'a> RefUnwindSafe for ParseContext<'a>
impl<'a> Send for ParseContext<'a>
impl<'a> Sync for ParseContext<'a>
impl<'a> Unpin for ParseContext<'a>
impl<'a> UnsafeUnpin for ParseContext<'a>
impl<'a> UnwindSafe for ParseContext<'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