pub struct TypeContract {
pub name: &'static str,
/* private fields */
}Expand description
One type this crate declares, with its schema and its canonical values.
Fields§
§name: &'static strThe type’s own name, which is also its schema’s file name.
Implementations§
Source§impl TypeContract
impl TypeContract
Sourcepub fn of<T: Sample + JsonSchema + Serialize + DeserializeOwned>(
name: &'static str,
) -> Self
pub fn of<T: Sample + JsonSchema + Serialize + DeserializeOwned>( name: &'static str, ) -> Self
The contract of one type, under the name its schema is written under.
This is how a crate other than this one declares a type of its own into
the schema set: its schemas test lists its types through this and
reconciles the files under schemas/<crate>/ against them, walking the
same round trip and the same absent-optional rule this crate’s own
contract tests walk.
Trait Implementations§
Source§impl Clone for TypeContract
impl Clone for TypeContract
impl Copy for TypeContract
Auto Trait Implementations§
impl Freeze for TypeContract
impl RefUnwindSafe for TypeContract
impl Send for TypeContract
impl Sync for TypeContract
impl Unpin for TypeContract
impl UnsafeUnpin for TypeContract
impl UnwindSafe for TypeContract
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