#[repr(transparent)]pub struct Id(pub ConstId<0, 0x2614_9574_d5fa_c1fe>);Tuple Fields§
§0: ConstId<0, 0x2614_9574_d5fa_c1fe>Implementations§
Source§impl Id
impl Id
pub const EMPTY: Self
pub const fn from_bits(bits: u64) -> Self
pub const fn to_bits(self) -> u64
pub const fn is_empty(self) -> bool
Sourcepub const fn from_str(value: &str) -> Self
pub const fn from_str(value: &str) -> Self
Examples found in repository?
examples/compiler_global.rs (line 90)
68fn perform_runtime_test(definition: Arc<GraphDefinition>) {
69 // 3. Create the graph
70 let mut graph = definition
71 .clone()
72 .build_with_empty_skeleton(Arc::new(EmptyResourceProvider));
73
74 // 4. Query the graph
75 let event = definition.get_event_by_name(TEST_EVENT).unwrap();
76 assert!(event.get(&graph) == FlowState::Exited);
77
78 // 5. Run the graph
79 let mut context = DefaultRunContext::new(1.0);
80 context.run(&mut graph);
81 assert!(context.events.emitted.is_empty());
82
83 assert!(event.get(&graph) == FlowState::Entered);
84
85 // 6. Modify parameters
86 let a = definition.get_number_parameter::<f32>("a").unwrap();
87 a.set(&mut graph, 4.0);
88
89 context.run(&mut graph);
90 assert_eq!(&context.events.emitted, &[Id::from_str(TEST_EVENT)]);
91}Trait Implementations§
Source§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
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 Ord for Id
impl Ord for Id
Source§impl PartialOrd for Id
impl PartialOrd for Id
impl Copy for Id
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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