pub struct TicketRotator { /* private fields */ }展开描述
A ticketer that has 一个 ‘current’ sub-ticketer 并 一个 single ‘previous’ ticketer. It creates 新 ticketer every so often, demoting the current ticketer.
实现§
Source§impl TicketRotator
impl TicketRotator
Sourcepub fn new(
lifetime: u32,
generator: fn() -> Result<Box<dyn ProducesTickets>, GetRandomFailed>,
) -> Result<Self, Error>
pub fn new( lifetime: u32, generator: fn() -> Result<Box<dyn ProducesTickets>, GetRandomFailed>, ) -> Result<Self, Error>
Creates 新 TicketRotator, which rotates through sub-ticketers
based on the passage of time.
lifetime is (单位:秒), 并 is how long the current ticketer
is 用 到 generate new tickets. Tickets are 已接受 用于 no
longer than twice this duration. generator produces 新
ProducesTickets implementation.
Trait 实现§
Source§impl Debug for TicketRotator
Available on crate feature std only.
impl Debug for TicketRotator
Available on crate feature
std only.Source§impl ProducesTickets for TicketRotator
Available on crate feature std only.
impl ProducesTickets for TicketRotator
Available on crate feature
std only.Source§fn lifetime(&self) -> u32
fn lifetime(&self) -> u32
Returns the lifetime (单位:秒) of tickets produced now.
此 lifetime , as 一个 hint 到 clients that the
ticket will not be useful after the given time. 更多信息
Source§fn enabled(&self) -> bool
fn enabled(&self) -> bool
如果此实现会加密/解密
tickets. Should 返回 false if this 是 dummy
implementation: the server will not send the SessionTicket
extension 并 will not call the other functions.
自动 Trait 实现§
impl !Freeze for TicketRotator
impl RefUnwindSafe for TicketRotator
impl Send for TicketRotator
impl Sync for TicketRotator
impl Unpin for TicketRotator
impl UnsafeUnpin for TicketRotator
impl UnwindSafe for TicketRotator
Blanket 实现§
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 从 an owned value. 更多信息