Skip to main content

ferroui_base/rendering/composition/generated/
composition_cache_mode.rs

1// @generated by scripts/generate_composition.py — do not edit
2
3//! `CompositionCacheMode`.
4//!
5//! Schema attributes: internal.
6
7use crate::rendering::composition::ICompositionObjectHost;
8use crate::rendering::composition::server::IServerAnimatedPropertyHost;
9use crate::rendering::composition::transport::BatchStreamReader;
10use crate::rendering::composition::transport::BatchStreamWriter;
11use std::any::Any;
12use std::any::TypeId;
13use std::time::Duration;
14
15/// The partial methods of `CompositionCacheMode`: implemented by the class that embeds
16/// [`CompositionCacheModeProps`]. Every hook defaults to doing nothing.
17pub trait CompositionCacheModeHooks: ICompositionObjectHost {
18    fn initialize_defaults_extra(&self) {}
19}
20
21/// The UI-thread properties of `CompositionCacheMode`.
22pub struct CompositionCacheModeProps {
23}
24
25impl Default for CompositionCacheModeProps {
26    fn default() -> Self {
27        Self::new()
28    }
29}
30
31impl CompositionCacheModeProps {
32    /// Creates the properties with every field at the default of its type.
33    /// The defaults of the schema are applied by
34    /// [`initialize_defaults`](Self::initialize_defaults).
35    pub fn new() -> Self {
36        Self {
37        }
38    }
39
40    /// The `InitializeDefaults` calls of the constructor chain: the base
41    /// classes first, then this class.
42    pub fn initialize_defaults(&self, host: &dyn CompositionCacheModeHooks) {
43        self.initialize_own_defaults(host);
44    }
45
46    /// `InitializeDefaults` of this class alone.
47    pub fn initialize_own_defaults(&self, host: &dyn CompositionCacheModeHooks) {
48        CompositionCacheModeHooks::initialize_defaults_extra(host);
49    }
50
51    /// Writes the changes of the object: the base class first, then the
52    /// changed-fields mask and the changed members of this class.
53    pub fn serialize_changes_core(&self, _host: &dyn CompositionCacheModeHooks, _writer: &mut BatchStreamWriter<'_>) {
54    }
55}
56
57/// The partial methods of `ServerCompositionCacheMode`: implemented by the class that embeds
58/// [`ServerCompositionCacheModeProps`]. Every hook defaults to doing nothing.
59pub trait ServerCompositionCacheModeHooks: IServerAnimatedPropertyHost {
60}
61
62/// The server-side properties of `ServerCompositionCacheMode`.
63pub struct ServerCompositionCacheModeProps {
64}
65
66impl Default for ServerCompositionCacheModeProps {
67    fn default() -> Self {
68        Self::new()
69    }
70}
71
72impl ServerCompositionCacheModeProps {
73    /// Creates the properties with every field at the default of its type; the
74    /// values of the UI thread arrive with the first batch.
75    pub fn new() -> Self {
76        Self {
77        }
78    }
79
80    /// This block or the block of a base class, by type: what
81    /// `IServerObject::get_props` of the embedding class returns.
82    pub fn find_props(&self, type_id: TypeId) -> Option<&dyn Any> {
83        if type_id == TypeId::of::<Self>() {
84            return Some(self);
85        }
86        None
87    }
88
89    /// Reads the changes of the object: the base class first, then the
90    /// changed-fields mask and the changed members of this class.
91    pub fn deserialize_changes_core(
92        &self,
93        _host: &dyn ServerCompositionCacheModeHooks,
94        _reader: &mut BatchStreamReader<'_>,
95        _committed_at: Duration,
96    ) {
97    }
98}