Skip to main content

HttpResolveResponse

Enum HttpResolveResponse 

Source
pub enum HttpResolveResponse {
    V1(HttpResolveResponse),
    V2(HttpResolveResponse),
    V3(HttpResolveResponse),
    V4(HttpResolveResponse),
}

Variants§

Trait Implementations§

Source§

impl Versioned for HttpResolveResponse

Source§

const LATEST: u16 = 4

The newest version, which Latest encodes.
Source§

const UPGRADES: &'static [Converter<Self>]

UPGRADES[i] converts version i + 1 to version i + 2.
Source§

const DOWNGRADES: &'static [Converter<Self>]

DOWNGRADES[i] converts version LATEST - i to version LATEST - i - 1.
Source§

type Latest = HttpResolveResponse

Source§

fn wrap_latest(latest: Self::Latest) -> Self

Source§

fn unwrap_latest(self) -> Result<Self::Latest>

Source§

fn decode_version(version: u16, payload: Bytes) -> Result<Self, DecodeError>

Decodes a body written at version, which is never LATEST.
Source§

fn encode_version<S: Sink>( &self, version: u16, out: &mut S, ) -> Result<(), EncodeError>

Encodes the variant this value holds. version is the version being written.
Source§

fn decode_body(body: Bytes, version: u16) -> Result<Self::Latest, DecodeError>

Decodes a body without a header, written at version.
Source§

fn open_body( body: Bytes, version: u16, ) -> Result<View<<Self::Latest as Message>::Wire>, DecodeError>
where Self::Latest: Message,

Views a body without a header, written at version. Latest-version bodies are viewed in place; older bodies are converted and re-encoded first.
Source§

fn encode_body<S>( value: &Self::Latest, version: u16, out: &mut S, ) -> Result<(), EncodeError>
where S: Sink,

Encodes value at version without a header, converting it down if needed.
Source§

fn decode(bytes: Bytes) -> Result<Self::Latest, DecodeError>

Decodes a payload with a version header to the latest version.
Source§

fn open( bytes: Bytes, ) -> Result<View<<Self::Latest as Message>::Wire>, DecodeError>
where Self::Latest: Message,

Views a payload with a version header. A latest-version payload is viewed without copying.
Source§

fn seal<S>( value: &Self::Latest, version: u16, out: &mut S, ) -> Result<(), EncodeError>
where S: Sink,

Writes the version header and value encoded at version into out.
Source§

fn sealed_len(value: &Self::Latest) -> usize

The exact number of bytes seal writes for value at the latest version: the header plus the body. An older version converts the value first, so its length is only known once it is encoded.
Source§

fn seal_to_vec( value: &Self::Latest, version: u16, ) -> Result<Vec<u8>, EncodeError>

seal into a new Vec.
Source§

fn seal_to_bytes( value: &Self::Latest, version: u16, ) -> Result<Bytes, EncodeError>

seal into a new Bytes, allocated once at the exact length for the latest version.
Source§

fn seal_to_slice( value: &Self::Latest, version: u16, out: &mut [u8], ) -> Result<usize, EncodeError>

Seals value at version into the front of out and returns the number of bytes written. Fails with EncodeError::BufferTooSmall instead of panicking when out is too short, and then writes nothing. Read more
Source§

fn deserialize_with_embedded_version( payload: &[u8], ) -> Result<Self::Latest, Error>

decode from a slice, under vbare 0.1’s name. Copies payload once; callers that hold Bytes should call decode instead.
Source§

fn serialize_with_embedded_version( value: &Self::Latest, version: u16, ) -> Result<Vec<u8>, Error>

seal_to_vec under vbare 0.1’s name. Takes the value by reference, so callers no longer clone it into wrap_latest.
Source§

fn deserialize(payload: &[u8], version: u16) -> Result<Self::Latest, Error>

decode_body from a slice, under vbare 0.1’s name. Copies payload once.
Source§

fn serialize(value: &Self::Latest, version: u16) -> Result<Vec<u8>, Error>

encode_body into a new Vec, under vbare 0.1’s name.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.