pub struct Pact {
pub name: CowStr,
pub docs: Option<CowStr>,
pub data_types: Cow<'static, [DataType]>,
}Expand description
In-memory (“intermediate”) representation of a pact.
This representiation may be used to manipulate pacts loaded or parsed from external systems; in most cases, this struct won’t need to be manually created.
Fields§
§name: CowStrName of the pact.
docs: Option<CowStr>Top-level documentation for the entire pact.
data_types: Cow<'static, [DataType]>All data types defined in the pact, in ascending order by their ordinals.
Implementations§
source§impl Pact
impl Pact
sourcepub fn new(name: impl IntoCowStr) -> Self
pub fn new(name: impl IntoCowStr) -> Self
Returns a new, empty pact with name.
sourcepub fn with_docs(self, docs: impl IntoCowStr) -> Self
pub fn with_docs(self, docs: impl IntoCowStr) -> Self
Returns self with docs, replacing any existing docs.
Trait Implementations§
source§impl PartialEq for Pact
impl PartialEq for Pact
impl StructuralPartialEq for Pact
Auto Trait Implementations§
impl Freeze for Pact
impl RefUnwindSafe for Pact
impl Send for Pact
impl Sync for Pact
impl Unpin for Pact
impl UnwindSafe for Pact
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