Debian Codegraph @

examples/static.rs

raw symbols SCIP
1 #![no_std]
2
3 use ringbufrust-analyzer cargo ringbuf 0.3.3 crate/::StaticRbrust-analyzer cargo ringbuf 0.3.3 alias/StaticRb#;
4
5 fn mainrust-analyzer cargo ringbuf 0.3.3 main().() {
6 const RB_SIZErust-analyzer cargo ringbuf 0.3.3 RB_SIZE.: usize = 1;
7 let mut rb = StaticRbrust-analyzer cargo ringbuf 0.3.3 alias/StaticRb#::<i32, RB_SIZErust-analyzer cargo ringbuf 0.3.3 RB_SIZE.>::defaultrust-analyzer cargo ringbuf 0.3.3 ring_buffer/init/impl#[`SharedRb<T, [MaybeUninit<T>; N]>`][Default]default().();
8 let (mut prod, mut cons) = rb.split_refrust-analyzer cargo ringbuf 0.3.3 ring_buffer/shared/impl#[`SharedRb<T, C>`]split_ref().();
9
10 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(prod.pushrust-analyzer cargo ringbuf 0.3.3 producer/impl#[`Producer<T, R>`]push().(123), Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()));
11 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(prod.pushrust-analyzer cargo ringbuf 0.3.3 producer/impl#[`Producer<T, R>`]push().(321), Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(321));
12
13 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(cons.poprust-analyzer cargo ringbuf 0.3.3 consumer/impl#[`Consumer<T, R>`]pop().(), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(123));
14 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(cons.poprust-analyzer cargo ringbuf 0.3.3 consumer/impl#[`Consumer<T, R>`]pop().(), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
15 }