pub struct TicketSwitcher { /* private fields */ }展开描述
A ticketer that has 一个 ‘current’ sub-ticketer 并 一个 single ‘previous’ ticketer. It creates 新 ticketer every so often, demoting the current ticketer.
实现§
Source§impl TicketSwitcher
impl TicketSwitcher
Sourcepub fn new(
lifetime: u32,
generator: fn() -> Result<Box<dyn ProducesTickets>, GetRandomFailed>,
) -> Result<Self, Error>
👎Deprecated: use TicketRotator instead
pub fn new( lifetime: u32, generator: fn() -> Result<Box<dyn ProducesTickets>, GetRandomFailed>, ) -> Result<Self, Error>
Creates 新 TicketSwitcher, 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 TicketSwitcher
impl Debug for TicketSwitcher
Source§impl ProducesTickets for TicketSwitcher
impl ProducesTickets for TicketSwitcher
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 TicketSwitcher
impl RefUnwindSafe for TicketSwitcher
impl Send for TicketSwitcher
impl Sync for TicketSwitcher
impl Unpin for TicketSwitcher
impl UnsafeUnpin for TicketSwitcher
impl UnwindSafe for TicketSwitcher
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. 更多信息