pub struct SceneCollectionDocument {
pub version: u32,
pub name: Option<String>,
pub sources: Vec<PersistedSource>,
pub scenes: Vec<PersistedScene>,
pub extra: BTreeMap<String, Value>,
}Fields§
§version: u32§name: Option<String>§sources: Vec<PersistedSource>§scenes: Vec<PersistedScene>§extra: BTreeMap<String, Value>Implementations§
Source§impl SceneCollectionDocument
impl SceneCollectionDocument
pub fn new(name: Option<String>) -> Self
Sourcepub fn capture_context(
context: &ObsContext,
) -> Result<Self, SceneCollectionError>
pub fn capture_context( context: &ObsContext, ) -> Result<Self, SceneCollectionError>
Captures every scene managed by context.
Sourcepub fn capture(scenes: &[ObsSceneRef]) -> Result<Self, SceneCollectionError>
pub fn capture(scenes: &[ObsSceneRef]) -> Result<Self, SceneCollectionError>
Captures the supplied managed scenes and every shared source/filter they reference.
pub fn from_json(json: &str) -> Result<Self, SceneCollectionError>
pub fn load(path: impl AsRef<Path>) -> Result<Self, SceneCollectionError>
pub fn to_json(&self) -> Result<String, SceneCollectionError>
Sourcepub fn export(
&self,
policy: SceneCollectionExportPolicy,
) -> Result<SceneCollectionExport, SceneCollectionError>
pub fn export( &self, policy: SceneCollectionExportPolicy, ) -> Result<SceneCollectionExport, SceneCollectionError>
Serializes using an explicit secret/path policy. Unknown JSON fields captured through
extra maps are preserved.
Sourcepub fn save_atomic(
&self,
path: impl AsRef<Path>,
policy: SceneCollectionExportPolicy,
) -> Result<Vec<ExportRedaction>, SceneCollectionError>
pub fn save_atomic( &self, path: impl AsRef<Path>, policy: SceneCollectionExportPolicy, ) -> Result<Vec<ExportRedaction>, SceneCollectionError>
Writes through a same-directory temporary file so serialization/write failures never truncate an existing collection. On platforms where rename-over-existing is unavailable, the old file is first moved to a backup and restored on replacement failure.
pub fn restore( &self, context: &mut ObsContext, mode: RestoreMode, ) -> Result<RestoredSceneCollection, SceneCollectionError>
Trait Implementations§
Source§impl Clone for SceneCollectionDocument
impl Clone for SceneCollectionDocument
Source§impl Debug for SceneCollectionDocument
impl Debug for SceneCollectionDocument
Source§impl<'de> Deserialize<'de> for SceneCollectionDocument
impl<'de> Deserialize<'de> for SceneCollectionDocument
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 SceneCollectionDocument
impl PartialEq for SceneCollectionDocument
Source§impl Serialize for SceneCollectionDocument
impl Serialize for SceneCollectionDocument
impl StructuralPartialEq for SceneCollectionDocument
Auto Trait Implementations§
impl Forget for SceneCollectionDocument
impl Freeze for SceneCollectionDocument
impl Move for SceneCollectionDocument
impl RefUnwindSafe for SceneCollectionDocument
impl Send for SceneCollectionDocument
impl Sync for SceneCollectionDocument
impl Unpin for SceneCollectionDocument
impl UnsafeUnpin for SceneCollectionDocument
impl UnwindSafe for SceneCollectionDocument
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