pub struct TypeTable {
pub enums: Vec<EnumDef>,
pub records: Vec<RecordDef>,
}Expand description
Named enum and record definitions referenced by Type.
Fields§
§enums: Vec<EnumDef>§records: Vec<RecordDef>Implementations§
Source§impl TypeTable
impl TypeTable
pub fn enum_def(&self, name: &str) -> Option<&EnumDef>
pub fn record_def(&self, name: &str) -> Option<&RecordDef>
Sourcepub fn merge(&mut self, other: &TypeTable) -> Result<(), SchemaError>
pub fn merge(&mut self, other: &TypeTable) -> Result<(), SchemaError>
Merge another table, rejecting different definitions with one name.
Sourcepub fn validate(&self) -> Result<(), SchemaError>
pub fn validate(&self) -> Result<(), SchemaError>
Check that every referenced name exists and that records do not contain themselves, which the first version cannot represent.
pub fn check_type( &self, ty: &Type, stack: &mut Vec<String>, ) -> Result<(), SchemaError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeTable
impl<'de> Deserialize<'de> for TypeTable
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 Eq for TypeTable
impl StructuralPartialEq for TypeTable
Auto Trait Implementations§
impl Freeze for TypeTable
impl RefUnwindSafe for TypeTable
impl Send for TypeTable
impl Sync for TypeTable
impl Unpin for TypeTable
impl UnsafeUnpin for TypeTable
impl UnwindSafe for TypeTable
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