Struct apollo_compiler::validation::Valid
source · pub struct Valid<T>(/* private fields */);Expand description
Wraps a Schema or ExecutableDocument to mark it
as valid.
This is obtained either by running validation with one of:
Schema::parse_and_validateSchema::validateExecutableDocument::parse_and_validateExecutableDocument::validate
… or by explicitly skipping it with Valid::assume_valid.
The schema or document inside Valid<T> is immutable (&mut T is not given out).
It can be extracted with into_inner,
such as to mutate it then possibly re-validate it.
Implementations§
source§impl<T> Valid<T>
impl<T> Valid<T>
sourcepub fn assume_valid(document: T) -> Self
pub fn assume_valid(document: T) -> Self
Construct a Valid document without actually running validation.
The caller takes responsibility to ascertain that the document is known through some other means to be valid. For example, if it was loaded from some external storag where it was only stored after validation.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Extract the schema or document, such as to mutate it then possibly re-validate it.
Trait Implementations§
source§impl<T: PartialEq> PartialEq for Valid<T>
impl<T: PartialEq> PartialEq for Valid<T>
impl<T: Eq> Eq for Valid<T>
impl<T> StructuralEq for Valid<T>
impl<T> StructuralPartialEq for Valid<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Valid<T>where T: RefUnwindSafe,
impl<T> Send for Valid<T>where T: Send,
impl<T> Sync for Valid<T>where T: Sync,
impl<T> Unpin for Valid<T>where T: Unpin,
impl<T> UnwindSafe for Valid<T>where T: 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
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.