pub enum ModelState {
Empty,
Loading,
Ready(Rc<ModelScene>),
Rejected(ModelError),
}Expand description
What the viewer has, as the host reports it.
Variants§
Empty
No model has been handed to this viewer.
Loading
The host is still reading one.
Ready(Rc<ModelScene>)
A document the reader accepted.
Rejected(ModelError)
A document the reader refused, and why.
Implementations§
Source§impl ModelState
impl ModelState
Sourcepub fn read(bytes: &[u8], bounds: ModelBounds) -> Self
pub fn read(bytes: &[u8], bounds: ModelBounds) -> Self
Reads a document and answers with the state it produced.
This is the whole of what a host has to do: the refusal is a state and not an error to be handled somewhere the reader cannot see it.
Trait Implementations§
Source§impl Clone for ModelState
impl Clone for ModelState
Source§fn clone(&self) -> ModelState
fn clone(&self) -> ModelState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelState
impl Debug for ModelState
Source§impl PartialEq for ModelState
impl PartialEq for ModelState
impl StructuralPartialEq for ModelState
Auto Trait Implementations§
impl !Send for ModelState
impl !Sync for ModelState
impl Freeze for ModelState
impl RefUnwindSafe for ModelState
impl Unpin for ModelState
impl UnsafeUnpin for ModelState
impl UnwindSafe for ModelState
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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 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> ⓘ
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