[−][src]Trait gf::support::protobuf::TaggedDataRepr
An object that can be represented as a TaggedData
structure.
Associated Constants
const TAG: &'static str
Supported tag.
const LATEST_VERSION: NonZeroU32
Latest supported version.
Versions 1 through LATEST_VERSION
must all be supported. Support for
a previous version can never be dropped.
Required methods
fn from_tagged_data(src: TaggedData) -> Result<Self, ProtobufError>
Convert from tagged data.
fn to_tagged_data_version(
&self,
version: NonZeroU32
) -> Result<TaggedData, ProtobufError>
&self,
version: NonZeroU32
) -> Result<TaggedData, ProtobufError>
Convert to tagged data using a specific version.
Errors
- Returns error if version is unsupported.
- Returns error if version is supported but is too old to represent this object.
Provided methods
fn to_tagged_data(&self) -> TaggedData
Convert to tagged data using the latest supported version.
The default implementation calls to_tagged_data_version
with
LATEST_VERSION
as version number.
fn from_tagged_data_bytes(bytes: &[u8]) -> Result<Self>
Deserialize from a slice of tagged data bytes.
fn to_tagged_data_bytes(&self) -> Vec<u8>
Serialize to a vector of tagged data bytes.
fn read_from_tagged_data_file<P: AsRef<Path>>(path: P) -> Result<Self>
Read from tagged data file.
fn write_to_tagged_data_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Write to tagged data file.
Implementors
impl TaggedDataRepr for UnsealedModule
[src]
const TAG: &'static str
[src]
const LATEST_VERSION: NonZeroU32
[src]
fn from_tagged_data(src: TaggedData) -> Result<Self, ProtobufError>
[src]
fn to_tagged_data_version(
&self,
version: NonZeroU32
) -> Result<TaggedData, ProtobufError>
[src]
&self,
version: NonZeroU32
) -> Result<TaggedData, ProtobufError>