diff options
author | metamuffin <metamuffin@disroot.org> | 2025-03-12 10:56:16 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-03-12 10:56:16 +0100 |
commit | cb9a60f45cb8438c58c2f1ecb2f59611dc5d515a (patch) | |
tree | 31330529a3b1b10a05f063bcaf245d562ed31f49 /src/classes/streaminginfo.rs | |
parent | bed5904c0575a96d52f6e7fc3df95d3b772ef196 (diff) | |
download | unity-tools-cb9a60f45cb8438c58c2f1ecb2f59611dc5d515a.tar unity-tools-cb9a60f45cb8438c58c2f1ecb2f59611dc5d515a.tar.bz2 unity-tools-cb9a60f45cb8438c58c2f1ecb2f59611dc5d515a.tar.zst |
extracted streaming data
Diffstat (limited to 'src/classes/streaminginfo.rs')
-rw-r--r-- | src/classes/streaminginfo.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/classes/streaminginfo.rs b/src/classes/streaminginfo.rs new file mode 100644 index 0000000..3ab271d --- /dev/null +++ b/src/classes/streaminginfo.rs @@ -0,0 +1,22 @@ +use crate::object::Value; +use anyhow::Result; +use serde::Serialize; + +use super::FromValue; + +#[derive(Debug, Serialize)] +pub struct StreamingInfo { + pub offset: u32, + pub path: String, + pub size: u32, +} +impl FromValue for StreamingInfo { + fn from_value(v: Value) -> Result<Self> { + let fields = v.as_class("StreamingInfo").unwrap(); + Ok(StreamingInfo { + offset: fields["offset"].as_u32().unwrap(), + size: fields["size"].as_u32().unwrap(), + path: fields["path"].to_owned().as_string().unwrap(), + }) + } +} |