pub struct SchemaSet { /* private fields */ }Expand description
The compiled schemas of one contract.
Implementations§
Source§impl SchemaSet
impl SchemaSet
Sourcepub fn load(dir: &Path, sec: &SchemasSection, report: &mut Report) -> Self
pub fn load(dir: &Path, sec: &SchemasSection, report: &mut Report) -> Self
Loads and compiles every listed schema file, relative to dir.
E051 waits for the contract’s resources:
SchemaSet::report_tag_zero.
Sourcepub fn packed_layout(&self, t: &TypeId) -> Option<&Layout>
pub fn packed_layout(&self, t: &TypeId) -> Option<&Layout>
The layout of a packed type this set resolved, when its declaration has no finding.
Sourcepub fn resolve(
&mut self,
r: &TypeRef,
at: &str,
report: &mut Report,
) -> Option<TypeId>
pub fn resolve( &mut self, r: &TypeRef, at: &str, report: &mut Report, ) -> Option<TypeId>
Resolves a type reference, reporting E023/E024 at at.
Sourcepub fn field_names(&self, t: &TypeId) -> Option<Vec<String>>
pub fn field_names(&self, t: &TypeId) -> Option<Vec<String>>
The top-level field names of a message or object type, for the D21
lint. None for raw types, or when the shape is not plain.
Sourcepub fn has_tag_zero(&self) -> bool
pub fn has_tag_zero(&self) -> bool
Whether a listed packed file, with no E028, defines a type whose layout tag is 0: E051’s candidates, before a profile’s derivation sets any aside.
Sourcepub fn report_tag_zero(
&self,
derived: &BTreeSet<(String, String)>,
report: &mut Report,
)
pub fn report_tag_zero( &self, derived: &BTreeSet<(String, String)>, report: &mut Report, )
E051 (core §9.2, cascade 7), per type: each type of a listed packed
file with no E028 whose layout tag is 0, named by a resource or not,
“but a type a profile derives (§7.6)”. derived holds those, each
(stem, name): the contract’s loader asks the profiles that derive
types (config.v2’s Record and each Set<T>, config.v2 §3,
crate::config::v2::derived_types).
Auto Trait Implementations§
impl Forget for SchemaSet
impl Freeze for SchemaSetwhere
*const LeafNode<String, Artifact> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Artifact)>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<ProtoFile>: Freeze,
PhantomData<JsonFile>: Freeze,
PhantomData<PackedFile>: Freeze,
PhantomData<TagZero>: Freeze,
impl Move for SchemaSet
impl RefUnwindSafe for SchemaSet
impl Send for SchemaSetwhere
NodeRef<Owned, String, Artifact, LeafOrInternal>: Send,
BoxRaw<(String, Artifact)>: Send,
RawVecInner: Send,
Arc<DescriptorPoolInner>: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
NodeRef<Owned, String, Option<Layout>, LeafOrInternal>: Send,
BoxRaw<(String, Option<Layout>)>: Send,
&'static str: Send,
impl Sync for SchemaSetwhere
NodeRef<Owned, String, Artifact, LeafOrInternal>: Sync,
BoxRaw<(String, Artifact)>: Sync,
RawVecInner: Sync,
Arc<DescriptorPoolInner>: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
NodeRef<Owned, String, Option<Layout>, LeafOrInternal>: Sync,
BoxRaw<(String, Option<Layout>)>: Sync,
impl Unpin for SchemaSetwhere
*const LeafNode<String, Artifact> is !null: Unpin,
Box<(String, Artifact)>: Unpin,
*const u8 is !null: Unpin,
Arc<DescriptorPoolInner>: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
*const LeafNode<String, Option<Layout>> is !null: Unpin,
Box<(String, Option<Layout>)>: Unpin,
&'static str: Unpin,
impl UnsafeUnpin for SchemaSetwhere
*const LeafNode<String, Artifact> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Artifact)>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<ProtoFile>: UnsafeUnpin,
PhantomData<JsonFile>: UnsafeUnpin,
PhantomData<PackedFile>: UnsafeUnpin,
PhantomData<TagZero>: UnsafeUnpin,
impl UnwindSafe for SchemaSetwhere
BTreeMap<String, Artifact>: UnwindSafe,
RawVecInner: UnwindSafe,
Arc<DescriptorPoolInner>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BTreeMap<String, Option<Layout>>: UnwindSafe,
&'static str: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more