pub struct Array {
pub data_type: String,
}Expand description
An array of values of the same data type
Fields§
§data_type: StringThe data type for all elements
Implementations§
Source§impl Array
impl Array
Sourcepub fn export_schema(
&self,
custom_types: &HashMap<String, DataType>,
dependencies: &mut HashSet<String>,
) -> Result<Object, Error>
pub fn export_schema( &self, custom_types: &HashMap<String, DataType>, dependencies: &mut HashSet<String>, ) -> Result<Object, Error>
Creates a JSON schema from the array
§Parameters
custom_types: The map of all the custom types, used to check if a type is builtin or not
dependencies: A set to add all dependencies of this array to
Sourcepub fn schema_value(
&self,
value: &SerializationModel,
custom_types: &HashMap<String, DataType>,
) -> Result<JsonValue, Error>
pub fn schema_value( &self, value: &SerializationModel, custom_types: &HashMap<String, DataType>, ) -> Result<JsonValue, Error>
Converts a serialization model value into a JSON value of the for of this type
§Parameters
value: The serialization model to convert
custom_types: All the custom types in the schema
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Array
impl<'de> Deserialize<'de> for Array
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 Array
Auto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
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