#[non_exhaustive]pub struct DisplayText {
pub language: OcpiString<2>,
pub text: OcpiString<512>,
pub extensions: Extensions,
}Expand description
Text to be shown to an end user, tagged with its language.
language: Language Code ISO 639-1.text: Text to be displayed to a end user. No markup, html etc. allowed.
Spec: 2.3.0 §types_displaytext_class
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.language: OcpiString<2>Language Code ISO 639-1.
text: OcpiString<512>Text to be displayed to an end user. No markup, HTML etc. allowed.
extensions: ExtensionsUndocumented JSON fields, preserved verbatim.
Implementations§
Source§impl DisplayText
impl DisplayText
Sourcepub fn new(
language: impl Into<String>,
text: impl Into<String>,
) -> Result<Self, InvalidString>
pub fn new( language: impl Into<String>, text: impl Into<String>, ) -> Result<Self, InvalidString>
Creates a DisplayText.
§Errors
Returns InvalidString if the language code is not two characters or the text is
longer than 512 characters, or if either contains a control character.
Trait Implementations§
Source§impl Clone for DisplayText
impl Clone for DisplayText
Source§fn clone(&self) -> DisplayText
fn clone(&self) -> DisplayText
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DisplayText
impl Debug for DisplayText
Source§impl<'de> Deserialize<'de> for DisplayText
impl<'de> Deserialize<'de> for DisplayText
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for DisplayText
Available on crate feature schema only.
impl JsonSchema for DisplayText
Available on crate feature
schema only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for DisplayText
impl PartialEq for DisplayText
Source§impl Serialize for DisplayText
impl Serialize for DisplayText
impl StructuralPartialEq for DisplayText
Source§impl Validate for DisplayText
impl Validate for DisplayText
Auto Trait Implementations§
impl Freeze for DisplayText
impl RefUnwindSafe for DisplayText
impl Send for DisplayText
impl Sync for DisplayText
impl Unpin for DisplayText
impl UnsafeUnpin for DisplayText
impl UnwindSafe for DisplayText
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