pub struct RenderSession {
pub schema: u16,
pub scene: SceneDescription,
pub camera: Camera,
pub profile: RenderProfile,
}Expand description
A reproducible figure/session envelope.
Fields§
§schema: u16Schema version of this presentation envelope.
scene: SceneDescriptionCore scene composition and source fingerprints.
camera: CameraCamera state used for the frame.
profile: RenderProfileOrdered, weighted presentation modules.
Implementations§
Source§impl RenderSession
impl RenderSession
Sourcepub fn new(scene: &Scene, camera: Camera, profile: RenderProfile) -> Self
pub fn new(scene: &Scene, camera: Camera, profile: RenderProfile) -> Self
Captures scene composition without copying caller-owned source data.
Sourcepub fn to_json(&self) -> Result<String, RenderError>
pub fn to_json(&self) -> Result<String, RenderError>
Encodes the complete session as stable pretty JSON.
§Errors
Returns RenderError::SessionEncoding when serialization fails.
Sourcepub fn from_json(source: &str) -> Result<Self, RenderError>
pub fn from_json(source: &str) -> Result<Self, RenderError>
Decodes and validates a session envelope without loading sources.
§Errors
Returns RenderError::SessionEncoding for malformed JSON or an
unsupported session schema.
Sourcepub fn restore(
&self,
sources: SceneDescriptionSources<'_>,
) -> Result<(Scene, Camera, RenderProfile), CoreError>
pub fn restore( &self, sources: SceneDescriptionSources<'_>, ) -> Result<(Scene, Camera, RenderProfile), CoreError>
Rehydrates the core scene from the caller’s source allocations.
§Errors
Returns the core validation error when a source fingerprint, handle or scene-owned payload does not match the session.
Trait Implementations§
Source§impl Clone for RenderSession
impl Clone for RenderSession
Source§impl Debug for RenderSession
impl Debug for RenderSession
Source§impl<'de> Deserialize<'de> for RenderSession
impl<'de> Deserialize<'de> for RenderSession
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RenderSession
impl PartialEq for RenderSession
Source§impl Serialize for RenderSession
impl Serialize for RenderSession
impl StructuralPartialEq for RenderSession
Auto Trait Implementations§
impl Freeze for RenderSession
impl RefUnwindSafe for RenderSession
impl Send for RenderSession
impl Sync for RenderSession
impl Unpin for RenderSession
impl UnsafeUnpin for RenderSession
impl UnwindSafe for RenderSession
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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