ferroui-base 0.2.0

The base library of FerroUI: the property system, layout, input, styling, media, text, animation, data binding and the compositor
Documentation
// @generated by scripts/generate_composition.py — do not edit

//! `CompositionCacheMode`.
//!
//! Schema attributes: internal.

use crate::rendering::composition::ICompositionObjectHost;
use crate::rendering::composition::server::IServerAnimatedPropertyHost;
use crate::rendering::composition::transport::BatchStreamReader;
use crate::rendering::composition::transport::BatchStreamWriter;
use std::any::Any;
use std::any::TypeId;
use std::time::Duration;

/// The partial methods of `CompositionCacheMode`: implemented by the class that embeds
/// [`CompositionCacheModeProps`]. Every hook defaults to doing nothing.
pub trait CompositionCacheModeHooks: ICompositionObjectHost {
    fn initialize_defaults_extra(&self) {}
}

/// The UI-thread properties of `CompositionCacheMode`.
pub struct CompositionCacheModeProps {
}

impl Default for CompositionCacheModeProps {
    fn default() -> Self {
        Self::new()
    }
}

impl CompositionCacheModeProps {
    /// Creates the properties with every field at the default of its type.
    /// The defaults of the schema are applied by
    /// [`initialize_defaults`](Self::initialize_defaults).
    pub fn new() -> Self {
        Self {
        }
    }

    /// The `InitializeDefaults` calls of the constructor chain: the base
    /// classes first, then this class.
    pub fn initialize_defaults(&self, host: &dyn CompositionCacheModeHooks) {
        self.initialize_own_defaults(host);
    }

    /// `InitializeDefaults` of this class alone.
    pub fn initialize_own_defaults(&self, host: &dyn CompositionCacheModeHooks) {
        CompositionCacheModeHooks::initialize_defaults_extra(host);
    }

    /// Writes the changes of the object: the base class first, then the
    /// changed-fields mask and the changed members of this class.
    pub fn serialize_changes_core(&self, _host: &dyn CompositionCacheModeHooks, _writer: &mut BatchStreamWriter<'_>) {
    }
}

/// The partial methods of `ServerCompositionCacheMode`: implemented by the class that embeds
/// [`ServerCompositionCacheModeProps`]. Every hook defaults to doing nothing.
pub trait ServerCompositionCacheModeHooks: IServerAnimatedPropertyHost {
}

/// The server-side properties of `ServerCompositionCacheMode`.
pub struct ServerCompositionCacheModeProps {
}

impl Default for ServerCompositionCacheModeProps {
    fn default() -> Self {
        Self::new()
    }
}

impl ServerCompositionCacheModeProps {
    /// Creates the properties with every field at the default of its type; the
    /// values of the UI thread arrive with the first batch.
    pub fn new() -> Self {
        Self {
        }
    }

    /// This block or the block of a base class, by type: what
    /// `IServerObject::get_props` of the embedding class returns.
    pub fn find_props(&self, type_id: TypeId) -> Option<&dyn Any> {
        if type_id == TypeId::of::<Self>() {
            return Some(self);
        }
        None
    }

    /// Reads the changes of the object: the base class first, then the
    /// changed-fields mask and the changed members of this class.
    pub fn deserialize_changes_core(
        &self,
        _host: &dyn ServerCompositionCacheModeHooks,
        _reader: &mut BatchStreamReader<'_>,
        _committed_at: Duration,
    ) {
    }
}