[][src]Struct gf::support::protobuf::TaggedData

pub struct TaggedData {
    pub tag: String,
    pub version: NonZeroU32,
    pub metadata: HashMap<String, String>,
    pub payload: Vec<u8>,
}

Arbitrary data tagged with data format, version, and a collection of key-value metadata.

Fields

tag: String

Data format tag.

version: NonZeroU32

Data format version (within the tag namespace).

metadata: HashMap<String, String>

Metadata key-value pairs.

payload: Vec<u8>

Payload.

Implementations

impl TaggedData[src]

pub fn from_bytes(bytes: &[u8]) -> Result<Self, ProtobufError>[src]

Deserialize from a slice of bytes.

pub fn to_bytes(&self) -> Vec<u8>[src]

Serialize to a vector of bytes.

pub fn read_from_file<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Read tagged data from file.

pub fn write_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>[src]

Write tagged data to file.

Trait Implementations

impl Clone for TaggedData[src]

impl Debug for TaggedData[src]

impl Eq for TaggedData[src]

impl PartialEq<TaggedData> for TaggedData[src]

impl StructuralEq for TaggedData[src]

impl StructuralPartialEq for TaggedData[src]

Auto Trait Implementations

impl RefUnwindSafe for TaggedData

impl Send for TaggedData

impl Sync for TaggedData

impl Unpin for TaggedData

impl UnwindSafe for TaggedData

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.