pub struct Address {
pub name: String,
pub address1: String,
pub city: String,
pub country: String,
pub address2: Option<String>,
pub postal_code: Option<String>,
pub custom_data: Option<CustomData>,
}Expand description
(2.1) A generic address format.
The OCPP 2.1 Address data type.
Fields§
§name: StringName of person/company
address1: StringAddress line 1
city: StringCity
country: StringCountry name
address2: Option<String>Address line 2
postal_code: Option<String>Postal code
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl Address
impl Address
Sourcepub fn new(
name: impl Into<String>,
address1: impl Into<String>,
city: impl Into<String>,
country: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, address1: impl Into<String>, city: impl Into<String>, country: impl Into<String>, ) -> Self
Creates a Address from its required fields.
Sourcepub fn with_address2(self, value: impl Into<String>) -> Self
pub fn with_address2(self, value: impl Into<String>) -> Self
Sets the optional address2 field.
Sourcepub fn with_postal_code(self, value: impl Into<String>) -> Self
pub fn with_postal_code(self, value: impl Into<String>) -> Self
Sets the optional postalCode field.
Sourcepub fn with_custom_data(self, value: CustomData) -> Self
pub fn with_custom_data(self, value: CustomData) -> Self
Sets the optional customData field.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Address
impl<'de> Deserialize<'de> for Address
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
impl StructuralPartialEq for Address
Source§impl Validate for Address
impl Validate for Address
Source§fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
Appends this value’s violations to
out, relative to path.Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnsafeUnpin for Address
impl UnwindSafe for Address
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