pub trait Format: 'static + Send {
const TOKEN_LEN: usize;
fn generate_new_token(
&mut self,
context: &mut Context<'_>,
source_connection_id: &LocalId,
output_buffer: &mut [u8]
) -> Option<()>;
fn generate_retry_token(
&mut self,
context: &mut Context<'_>,
original_destination_connection_id: &InitialId,
output_buffer: &mut [u8]
) -> Option<()>;
fn validate_token(
&mut self,
context: &mut Context<'_>,
token: &[u8]
) -> Option<InitialId>;
}
Required Associated Constants
Required Methods
sourcefn generate_new_token(
&mut self,
context: &mut Context<'_>,
source_connection_id: &LocalId,
output_buffer: &mut [u8]
) -> Option<()>
fn generate_new_token(
&mut self,
context: &mut Context<'_>,
source_connection_id: &LocalId,
output_buffer: &mut [u8]
) -> Option<()>
Generate a signed token to be delivered in a NEW_TOKEN frame. This function will only be called if the provider support NEW_TOKEN frames.