Skip to main content

TypeLookupStack

Struct TypeLookupStack 

Source
pub struct TypeLookupStack {
    pub local_prefix: GuidPrefix,
    pub registry: TypeRegistry,
    /* private fields */
}
Expand description

TypeLookup-Stack fuer einen lokalen Participant.

Fields§

§local_prefix: GuidPrefix

Eigener Prefix (fuer Request-/Reply-GUIDs).

§registry: TypeRegistry

Registry von bereits empfangenen TypeObjects.

Implementations§

Source§

impl TypeLookupStack

Source

pub fn new(local_prefix: GuidPrefix) -> Self

Konstruiert einen leeren Stack.

Source

pub fn request_writer_guid(&self) -> Guid

GUID des Request-Writers (von dem wir senden).

Source

pub fn reply_reader_guid(&self) -> Guid

GUID des Reply-Readers (auf dem wir empfangen).

Source

pub fn make_get_types_request( &mut self, hashes: &[EquivalenceHash], minimal: bool, ) -> Result<(Vec<u8>, u64), EncodeError>

Baut einen getTypes-Request fuer die angegebenen Hashes. Return: request-Payload-Bytes + neue Sequence-ID.

§Errors

EncodeError bei zu grossen Listen.

Source

pub fn handle_get_types_reply( &mut self, bytes: &[u8], ) -> Result<usize, TypeCodecError>

Verarbeitet ein empfangenes getTypes-Reply und tragt alle enthaltenen TypeObjects in die Registry ein.

§Errors

Decode-Fehler oder Hash-Berechnung scheitert.

Source

pub fn make_get_dependencies_request( &self, hashes: &[EquivalenceHash], cont: ContinuationPoint, ) -> Result<Vec<u8>, EncodeError>

Baut einen getTypeDependencies-Request.

§Errors

Encode.

Source

pub fn parse_dependencies_reply( &self, bytes: &[u8], ) -> Result<GetTypeDependenciesReply, TypeCodecError>

Decoded ein getTypeDependencies-Reply (fuer Tests / Caller).

§Errors

Decode.

Source

pub fn build_get_types_reply( &self, hashes: &[EquivalenceHash], minimal: bool, ) -> Result<Vec<u8>, EncodeError>

Responder-Helper: baut einen getTypes-Reply aus der Registry. Unbekannte Hashes werden ausgelassen.

§Errors

Encode.

Trait Implementations§

Source§

impl Debug for TypeLookupStack

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.