Skip to main content

SchemaSet

Struct SchemaSet 

Source
pub struct SchemaSet { /* private fields */ }
Expand description

The compiled schemas of one contract.

Implementations§

Source§

impl SchemaSet

Source

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.

Source

pub fn packed_layout(&self, t: &TypeId) -> Option<&Layout>

The layout of a packed type this set resolved, when its declaration has no finding.

Source

pub fn resolve( &mut self, r: &TypeRef, at: &str, report: &mut Report, ) -> Option<TypeId>

Resolves a type reference, reporting E023/E024 at at.

Source

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.

Source

pub fn artifacts(&self) -> &BTreeMap<String, Artifact>

Every artifact, by id.

Source

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.

Source

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 SchemaSet
where *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 SchemaSet
where 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 SchemaSet
where 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 SchemaSet
where *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 SchemaSet
where *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 SchemaSet

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsNode<T> for T

Source§

fn as_node(&self) -> &T

Source§

impl<T> AsNodeMut<T> for T

Source§

fn as_node_mut(&mut self) -> &mut T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.