pub struct EmbeddedNodeRuntime { /* private fields */ }Implementations§
Source§impl EmbeddedNodeRuntime
impl EmbeddedNodeRuntime
Sourcepub fn new(config: RuntimeConfig) -> EmbeddedResult<Self>
pub fn new(config: RuntimeConfig) -> EmbeddedResult<Self>
Examples found in repository?
examples/manual_tick_runtime.rs (line 8)
7fn main() {
8 let mut runtime = EmbeddedNodeRuntime::new(RuntimeConfig::default()).expect("runtime");
9 let mut store = JournaledEmbeddedStore::new();
10 let mut transport = BleShimTransport::new(BleShimConfig::default()).expect("transport");
11
12 transport.set_link_state(LinkState::Up);
13 runtime.tick(0, &mut transport, &mut store).expect("tick");
14 runtime.queue_message([0x44; 16], b"hello from manual tick").expect("queue message");
15 runtime.tick(1_000, &mut transport, &mut store).expect("tick");
16
17 while let Some(frame) = transport.take_outbound_wire() {
18 println!("outbound frame bytes={}", frame.len());
19 }
20}pub fn bootstrap<S: EmbeddedStore>(&mut self, store: &S) -> EmbeddedResult<()>
Sourcepub fn tick<T: EmbeddedTransport, S: EmbeddedStore>(
&mut self,
now_ms: u64,
transport: &mut T,
store: &mut S,
) -> EmbeddedResult<()>
pub fn tick<T: EmbeddedTransport, S: EmbeddedStore>( &mut self, now_ms: u64, transport: &mut T, store: &mut S, ) -> EmbeddedResult<()>
Examples found in repository?
examples/manual_tick_runtime.rs (line 13)
7fn main() {
8 let mut runtime = EmbeddedNodeRuntime::new(RuntimeConfig::default()).expect("runtime");
9 let mut store = JournaledEmbeddedStore::new();
10 let mut transport = BleShimTransport::new(BleShimConfig::default()).expect("transport");
11
12 transport.set_link_state(LinkState::Up);
13 runtime.tick(0, &mut transport, &mut store).expect("tick");
14 runtime.queue_message([0x44; 16], b"hello from manual tick").expect("queue message");
15 runtime.tick(1_000, &mut transport, &mut store).expect("tick");
16
17 while let Some(frame) = transport.take_outbound_wire() {
18 println!("outbound frame bytes={}", frame.len());
19 }
20}Sourcepub fn queue_message(
&mut self,
destination: [u8; 16],
body: &[u8],
) -> EmbeddedResult<u32>
pub fn queue_message( &mut self, destination: [u8; 16], body: &[u8], ) -> EmbeddedResult<u32>
Examples found in repository?
examples/manual_tick_runtime.rs (line 14)
7fn main() {
8 let mut runtime = EmbeddedNodeRuntime::new(RuntimeConfig::default()).expect("runtime");
9 let mut store = JournaledEmbeddedStore::new();
10 let mut transport = BleShimTransport::new(BleShimConfig::default()).expect("transport");
11
12 transport.set_link_state(LinkState::Up);
13 runtime.tick(0, &mut transport, &mut store).expect("tick");
14 runtime.queue_message([0x44; 16], b"hello from manual tick").expect("queue message");
15 runtime.tick(1_000, &mut transport, &mut store).expect("tick");
16
17 while let Some(frame) = transport.take_outbound_wire() {
18 println!("outbound frame bytes={}", frame.len());
19 }
20}pub fn pending_outbound_len(&self) -> usize
pub fn config(&self) -> RuntimeConfig
pub fn lifecycle_state(&self) -> NodeLifecycleState
pub fn set_network_provisioned(&mut self, provisioned: bool)
pub fn set_ble_recovery_active(&mut self, active: bool)
pub fn stats(&self) -> RuntimeStats
pub fn drain_events(&mut self) -> Vec<RuntimeEvent>
Auto Trait Implementations§
impl Freeze for EmbeddedNodeRuntime
impl RefUnwindSafe for EmbeddedNodeRuntime
impl Send for EmbeddedNodeRuntime
impl Sync for EmbeddedNodeRuntime
impl Unpin for EmbeddedNodeRuntime
impl UnsafeUnpin for EmbeddedNodeRuntime
impl UnwindSafe for EmbeddedNodeRuntime
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