pub struct SchemaLinker { /* private fields */ }
Expand description
Acccumulates schema definitions defined in code or by json. Once schemas have been loaded, they
are “linked”, producing read-only schemas that are hashed and may cyclically reference each
other. The individual schemas are also very cheap to clone as they are stored in Arc
Implementations§
Source§impl SchemaLinker
impl SchemaLinker
pub fn unlinked_type_names(&self) -> Vec<String>
pub fn add_source_dir<PathT, PatternT>( &mut self, path: PathT, pattern: PatternT, ) -> Result<(), SchemaLinkerError>
pub fn register_record_type<F>(
&mut self,
name: impl Into<String>,
type_uuid: Uuid,
f: F,
) -> Result<(), SchemaLinkerError>where
F: Fn(&mut RecordTypeBuilder),
pub fn register_enum_type<F>(
&mut self,
name: impl Into<String>,
type_uuid: Uuid,
f: F,
) -> Result<(), SchemaLinkerError>where
F: Fn(&mut EnumTypeBuilder),
pub fn link_schemas(self) -> Result<LinkedSchemas, SchemaLinkerError>
Trait Implementations§
Source§impl Default for SchemaLinker
impl Default for SchemaLinker
Source§fn default() -> SchemaLinker
fn default() -> SchemaLinker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SchemaLinker
impl RefUnwindSafe for SchemaLinker
impl Send for SchemaLinker
impl Sync for SchemaLinker
impl Unpin for SchemaLinker
impl UnwindSafe for SchemaLinker
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