Struct fog_pack::schema::NoSchema [−][src]
Validation for documents without a schema.
Not all documents adhere to a schema, but they must still be verified for correctness and be
optionally compressed on encoding. This NoSchema struct acts like a Schema to accomplish
this.
As schemaless documents cannot have attached entries, NoSchema does not do any entry
encode/decode.
Implementations
impl NoSchema[src]
pub fn validate_new_doc(doc: NewDocument) -> Result<Document>[src]
Encode a NewDocument, returning the resulting Document’s hash and fully encoded format.
Fails if the internal data isn’t actually valid fog-pack, which can sometimes happen with a
bad Serialize implementation for the data.
pub fn encode_doc(doc: Document) -> Result<(Hash, Vec<u8>)>[src]
Re-encode a validated Document, returning the resulting Document’s hash and fully encoded
format.
pub fn decode_doc(doc: Vec<u8>) -> Result<Document>[src]
Decode a document that doesn’t have a schema.
pub fn trusted_decode_doc(doc: Vec<u8>) -> Result<Document>[src]
Decode a Document, skipping any checks of the data. This should only be run when the raw
document has definitely been passed through validation before, i.e. if it is stored in a
local database after going through encode_doc.
Auto Trait Implementations
impl RefUnwindSafe for NoSchema
impl Send for NoSchema
impl Sync for NoSchema
impl Unpin for NoSchema
impl UnwindSafe for NoSchema
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,