Struct cocaine::Request [] [src]

pub struct Request { /* fields omitted */ }

A generic Cocaine request.

Encapsulates all required parameters to be able to perform a service call.

Examples

use cocaine::Request;
use cocaine::hpack::{Header, TraceId, SpanId};

let request = Request::new(0, &["event"]).unwrap()
    .add_headers(vec![TraceId(0).into_raw(), SpanId(42).into_raw()]);

assert_eq!(0, request.ty());

Errors

A serialization error is returned when it's failed to serialize the given arguments into a vector. However, while a vector is grown automatically, it may only fail when there is no memory left for allocation.

Methods

impl Request
[src]

[src]

Constructs a new request object using the given message type and arguments, performing an automatic serialization.

[src]

Returns a request type.

[src]

Returns a serialized request arguments as a slice.

[src]

Returns a reference to the request headers.

[src]

Adds a header to the request.

[src]

Adds an iterable headers object to the request.

Trait Implementations

impl Clone for Request
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Request
[src]

[src]

Formats the value using the given formatter.