pub struct ScenePck {
pub buf: Arc<Vec<u8>>,
pub header: PackScnHeader,
pub scn_name_map: HashMap<String, usize>,
pub inc_prop_name_map: HashMap<u32, String>,
pub inc_cmd_name_map: Arc<HashMap<u32, String>>,
pub inc_props: Vec<PackIncProp>,
pub inc_cmds: Vec<PackIncCmd>,
pub string_codec: SceneStringCodec,
/* private fields */
}Fields§
§buf: Arc<Vec<u8>>§header: PackScnHeader§scn_name_map: HashMap<String, usize>§inc_prop_name_map: HashMap<u32, String>§inc_cmd_name_map: Arc<HashMap<u32, String>>§inc_props: Vec<PackIncProp>§inc_cmds: Vec<PackIncCmd>§string_codec: SceneStringCodecImplementations§
Source§impl ScenePck
impl ScenePck
pub fn load_and_rebuild( path: &Path, opt: &ScenePckDecodeOptions, ) -> Result<Self>
pub fn load_and_rebuild_from_bytes( tmp: Vec<u8>, opt: &ScenePckDecodeOptions, ) -> Result<Self>
Sourcepub fn load_lazy(path: &Path, opt: &ScenePckDecodeOptions) -> Result<Self>
pub fn load_lazy(path: &Path, opt: &ScenePckDecodeOptions) -> Result<Self>
Opens a pack without rebuilding it: scenes stay compressed (a quarter of the rebuilt size for RewriteHF, 11 MiB instead of 43) and are decompressed when a scene is first used.
pub fn load_lazy_from_bytes( tmp: Vec<u8>, opt: &ScenePckDecodeOptions, ) -> Result<Self>
Sourcepub fn scn_data_slice(&self, scn_no: usize) -> Result<Cow<'_, [u8]>>
pub fn scn_data_slice(&self, scn_no: usize) -> Result<Cow<'_, [u8]>>
A scene’s bytecode (decompressed first for a lazily loaded pack).
Return shared backing storage plus the scene-local byte range. SceneStream uses this to borrow directly from the rebuilt Scene.pck (or, lazily loaded, from the scene’s own decompressed buffer) without copying or leaking each visited scene chunk.
pub fn find_scene_no(&self, name_or_index: &str) -> Option<usize>
pub fn find_scene_name(&self, scn_no: usize) -> Option<&str>
pub fn find_inc_cmd_no(&self, cmd_name: &str) -> Option<usize>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScenePck
impl RefUnwindSafe for ScenePck
impl Send for ScenePck
impl Sync for ScenePck
impl Unpin for ScenePck
impl UnsafeUnpin for ScenePck
impl UnwindSafe for ScenePck
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