pub struct Template {
pub version: Option<String>,
pub metrics: Vec<Metric>,
pub parameters: Vec<Parameter>,
pub template_ref: Option<String>,
pub is_definition: Option<bool>,
}Fields§
§version: Option<String>The version of the Template to prevent mismatches
metrics: Vec<Metric>Each metric includes a name, datatype, and optionally a value
parameters: Vec<Parameter>§template_ref: Option<String>MUST be a reference to a template definition if this is an instance (i.e. the name of the template definition) - MUST be omitted for template definitions
is_definition: Option<bool>Implementations§
Source§impl Template
impl Template
Sourcepub fn version(&self) -> &str
pub fn version(&self) -> &str
Returns the value of version, or the default value if version is unset.
Sourcepub fn template_ref(&self) -> &str
pub fn template_ref(&self) -> &str
Returns the value of template_ref, or the default value if template_ref is unset.
Sourcepub fn is_definition(&self) -> bool
pub fn is_definition(&self) -> bool
Returns the value of is_definition, or the default value if is_definition is unset.
Trait Implementations§
Source§impl From<TemplateDefinition> for Template
impl From<TemplateDefinition> for Template
Source§fn from(value: TemplateDefinition) -> Self
fn from(value: TemplateDefinition) -> Self
Converts to this type from the input type.
Source§impl From<TemplateInstance> for Template
impl From<TemplateInstance> for Template
Source§fn from(value: TemplateInstance) -> Self
fn from(value: TemplateInstance) -> Self
Converts to this type from the input type.
Source§impl Message for Template
impl Message for Template
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnwindSafe for Template
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more