pub struct StreamSession {
pub config: StreamConfig,
pub frames: Vec<StreamFrame>,
pub base_frame: Option<StreamFrame>,
/* private fields */
}Expand description
An active streaming session accumulating frames.
Fields§
§config: StreamConfig§frames: Vec<StreamFrame>§base_frame: Option<StreamFrame>Implementations§
Source§impl StreamSession
impl StreamSession
Sourcepub fn new(config: StreamConfig) -> Self
pub fn new(config: StreamConfig) -> Self
Create a new session.
Sourcepub fn push_frame(&mut self, positions: Vec<[f32; 3]>, normals: Vec<[f32; 3]>)
pub fn push_frame(&mut self, positions: Vec<[f32; 3]>, normals: Vec<[f32; 3]>)
Push a new frame into the session.
Sourcepub fn encode_frame(&self, idx: usize) -> Vec<u8> ⓘ
pub fn encode_frame(&self, idx: usize) -> Vec<u8> ⓘ
Encode a stored frame by index based on session compression config.
Sourcepub fn decode_frame(data: &[u8]) -> Option<StreamFrame>
pub fn decode_frame(data: &[u8]) -> Option<StreamFrame>
Decode a frame from bytes.
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Number of frames in this session.
Sourcepub fn avg_frame_size(&self) -> f32
pub fn avg_frame_size(&self) -> f32
Average encoded size (bytes) over all frames.
Auto Trait Implementations§
impl Freeze for StreamSession
impl RefUnwindSafe for StreamSession
impl Send for StreamSession
impl Sync for StreamSession
impl Unpin for StreamSession
impl UnsafeUnpin for StreamSession
impl UnwindSafe for StreamSession
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> 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