Struct OdcsContract
pub struct OdcsContract {
pub api_version: String,
pub kind: String,
pub id: String,
pub version: String,
pub status: String,
pub name: Option<String>,
pub schema: Vec<SchemaObject>,
}Expand description
A minimal ODCS v3.1.0 data contract, sufficient to describe a schema.
Fields§
§api_version: StringODCS spec version — "v3.1.0".
kind: StringAlways "DataContract".
id: StringStable contract identifier.
version: StringContract (not spec) version.
status: StringLifecycle status, e.g. "draft", "active".
name: Option<String>§schema: Vec<SchemaObject>Implementations§
§impl OdcsContract
impl OdcsContract
pub fn new(
id: impl Into<String>,
version: impl Into<String>,
status: impl Into<String>,
) -> OdcsContract
pub fn new( id: impl Into<String>, version: impl Into<String>, status: impl Into<String>, ) -> OdcsContract
A contract with the required fields set and v3.1.0/DataContract fixed.
pub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Serialise to pretty JSON.
§Errors
Propagates any serde_json serialisation error (not expected for this model).
Trait Implementations§
§impl Clone for OdcsContract
impl Clone for OdcsContract
§fn clone(&self) -> OdcsContract
fn clone(&self) -> OdcsContract
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for OdcsContract
impl Debug for OdcsContract
§impl Serialize for OdcsContract
impl Serialize for OdcsContract
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for OdcsContract
impl RefUnwindSafe for OdcsContract
impl Send for OdcsContract
impl Sync for OdcsContract
impl Unpin for OdcsContract
impl UnwindSafe for OdcsContract
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