Struct binate::frame::codec::ErrorFrame[][src]

pub struct ErrorFrame { /* fields omitted */ }
This is supported on crate feature frame only.
Expand description

The error frame.

Error frames are used for errors on individual requests/streams as well as connection errors and in response to SETUP frames.

Frame Contents

0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Stream ID                           |
+-----------+-+-+---------------+-------------------------------+
|Frame Type |0|0|      Flags    |
+-----------+-+-+---------------+-------------------------------+
|                          Error Code                           |
+---------------------------------------------------------------+
                           Error Data

A Stream ID of 0 means the error pertains to the connection., including connection establishment. A Stream ID > 0 means the error pertains to a given stream.

The Error Data is typically an Exception message, but could include stringified stacktrace information if appropriate.

See the Frame Error section of the RSocket protocol spec for more information.

Implementations

The Setup frame is invalid for the server (it could be that the client is too recent for the old server).

Stream ID MUST be 0.

Some (or all) of the parameters specified by the client are unsupported by the server.

Stream ID MUST be 0.

The server rejected the setup, it can specify the reason in the payload.

Stream ID MUST be 0.

The server rejected the resume, it can specify the reason in the payload.

Stream ID MUST be 0.

The connection is being terminated.

Sender or Receiver of this frame MAY close the connection immediately without waiting for outstanding streams to terminate. Stream ID MUST be 0.

The connection is being terminated.

Sender or Receiver of this frame MUST wait for outstanding streams to terminate before closing the connection. New requests MAY not be accepted. Stream ID MUST be 0.

Application layer logic generating a Reactive Streams onError event.

Stream ID MUST be > 0.

Despite being a valid request, the Responder decided to reject it.

The Responder guarantees that it didn’t process the request. The reason for the rejection is explained in the Error Data section. Stream ID MUST be > 0.

The Responder canceled the request but may have started processing it (similar to REJECTED but doesn’t guarantee lack of side-effects).

Stream ID MUST be > 0.

The request is invalid. Stream ID MUST be > 0.

The minimum error code that can used as application layer error.

The maximum error code that can used as application layer error.

Type of this frame.

Create a new ErrorFrame.

  • stream_id and error_code MUST be <= MAX_U31.
  • data SHOULD be a UTF-8 encoded string.

Returns the stream ID of this frame.

Returns the error code in this error frame.

Returns the error data attached to this frame, if any.

Returns the error data in this error frame in UTF-8 format. If the error data is not valid UTF-8, this will return None.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The value decoded into.

Decodes the given bytes into a frame.

Encodes self into bytes.

Returns the length (in bytes) of this value.

Returns whether this value is empty.

Encodes self into bytes. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.