Struct randomorg::Request[][src]

pub struct Request<Params: Serialize> {
    pub json_rpc: String,
    pub method: Method,
    pub params: Params,
    pub id: RequestId,
}

A random.org request holder

Fields

json_rpc: String

A json rpc version

method: Method

A name of the method to be invoked

params: Params

A structured value containing the parameters that will be supplied to the method.

id: RequestId

A request identifier that allows the client to match responses to request. The service will return this unchanged in its response.

Implementations

impl Request<ApiKeyParams>[src]

pub fn new(method: Method, api_key: ApiKey) -> Request<ApiKeyParams>[src]

Create an empty request.

impl Request<GenerateIntegersParams>[src]

pub fn new(
    api_key: ApiKey,
    min: i32,
    max: i32,
    limit: u16,
    replacement: bool
) -> Request<GenerateIntegersParams>
[src]

Create a request for integers generation.

impl Request<GenerateDecimalFractionsParams>[src]

pub fn new(
    api_key: ApiKey,
    limit: u16,
    decimal_places: u8
) -> Request<GenerateDecimalFractionsParams>
[src]

Create a request for decimal fractions generation.

impl Request<GenerateGaussiansParams>[src]

pub fn new(
    api_key: ApiKey,
    limit: u16,
    mean: i32,
    standard_deviation: i32,
    significant_digits: u8
) -> Request<GenerateGaussiansParams>
[src]

Create a request for gaussians generation.

impl Request<GenerateStringsParams>[src]

pub fn new(
    api_key: ApiKey,
    limit: u16,
    length: u8,
    characters: AllowedCharacters
) -> Request<GenerateStringsParams>
[src]

Create a request for strings generation.

impl Request<GenerateUUIDsParams>[src]

pub fn new(api_key: ApiKey, limit: u16) -> Request<GenerateUUIDsParams>[src]

Create a request for strings UUIDs generation.

impl Request<GenerateBlobsParams>[src]

pub fn new(
    api_key: ApiKey,
    limit: u16,
    size: u32
) -> Request<GenerateBlobsParams>
[src]

Create a request for blobs generation.

Trait Implementations

impl<Params: Clone + Serialize> Clone for Request<Params>[src]

impl<Params: Debug + Serialize> Debug for Request<Params>[src]

impl<Params: Serialize> Serialize for Request<Params> where
    Params: Serialize
[src]

Auto Trait Implementations

impl<Params> RefUnwindSafe for Request<Params> where
    Params: RefUnwindSafe
[src]

impl<Params> Send for Request<Params> where
    Params: Send
[src]

impl<Params> Sync for Request<Params> where
    Params: Sync
[src]

impl<Params> Unpin for Request<Params> where
    Params: Unpin
[src]

impl<Params> UnwindSafe for Request<Params> where
    Params: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.