[][src]Struct protofish::context::Context

pub struct Context { /* fields omitted */ }

Protofish decoding context.

Contains type information parsed from the files. Required for decoding incoming Protobuf messages.

Implementations

impl Context[src]

pub fn parse(files: &[&str]) -> Result<Self>[src]

Parses the files and creates a decoding context.

impl Context[src]

pub fn get_type(&self, full_name: &str) -> Option<&TypeInfo>[src]

Gets type info by name.

pub fn get_message(&self, full_name: &str) -> Option<&MessageInfo>[src]

Gets a message type info by name.

pub fn resolve_message(&self, tr: MessageRef) -> &MessageInfo[src]

Resolves a message reference.

Will panic if the message defined by the MessageRef does not exist in this context. Such panic means the MessageRef came from a different context. The panic is not guaranteed, as a message with an equal MessageRef may exist in multiple contexts.

pub fn resolve_enum(&self, tr: EnumRef) -> &EnumInfo[src]

Resolves a enum reference.

Will panic if the enum defined by the EnumRef does not exist in this context. Such panic means the EnumRef came from a different context. The panic is not guaranteed, as an enum with an equal EnumRef may exist in multiple contexts.

pub fn get_service(&self, full_name: &str) -> Option<&Service>[src]

Gets a service by full name.

Trait Implementations

impl Debug for Context[src]

impl Default for Context[src]

Auto Trait Implementations

impl RefUnwindSafe for Context

impl Send for Context

impl Sync for Context

impl Unpin for Context

impl UnwindSafe for Context

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, U> Into<U> for T where
    U: From<T>, 
[src]

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.