Skip to main content

RequestCommon

Trait RequestCommon 

Source
pub trait RequestCommon:
    Serialize
    + Deserialize
    + Send
    + Sync
    + Unpin
    + Debug
    + 'static {
    type Kind: RequestKind;
    type Response: Deserialize + Serialize + Send;

    const TYPE_ID: u16;
    const MAX_REQUESTS: u32;
    const TIME_WINDOW: Duration = DEFAULT_MAX_REQUEST_RESPONSE_TIME_WINDOW;

    // Provided method
    fn type_name<T>() -> &'static str { ... }
}

Required Associated Constants§

Provided Associated Constants§

Source

const TIME_WINDOW: Duration = DEFAULT_MAX_REQUEST_RESPONSE_TIME_WINDOW

Required Associated Types§

Provided Methods§

Source

fn type_name<T>() -> &'static str

Returns the type name of the given request type T. This only works for

  • non-generic types
  • generic types with a single level of nesting, in which case the name of the type parameter is returned

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§