File tree 2 files changed +35
-1
lines changed
2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change
1
+ //! Send a `.rrd` to a new recording stream.
2
+
3
+ use rerun:: external:: re_chunk_store:: { ChunkStore , ChunkStoreConfig } ;
4
+ use rerun:: external:: re_log_types:: { LogMsg , SetStoreInfo } ;
5
+ use rerun:: external:: re_tuid:: Tuid ;
6
+ use rerun:: VersionPolicy ;
7
+
8
+ fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
9
+ // Get the filename from the command-line args.
10
+ let filename = std:: env:: args ( ) . nth ( 2 ) . ok_or ( "Missing filename argument" ) ?;
11
+
12
+ // Load the chunk store from the file.
13
+ let ( store_id, store) =
14
+ ChunkStore :: from_rrd_filepath ( & ChunkStoreConfig :: DEFAULT , filename, VersionPolicy :: Warn ) ?
15
+ . into_iter ( )
16
+ . next ( )
17
+ . ok_or ( "Expected exactly one recording in the archive" ) ?;
18
+
19
+ // Use the same app and recording IDs as the original.
20
+ if let Some ( info) = store. info ( ) . cloned ( ) {
21
+ let new_recording = rerun:: RecordingStreamBuilder :: new ( info. application_id . clone ( ) )
22
+ . recording_id ( store_id. to_string ( ) )
23
+ . spawn ( ) ?;
24
+
25
+ new_recording. record_msg ( LogMsg :: SetStoreInfo ( SetStoreInfo {
26
+ row_id : Tuid :: new ( ) ,
27
+ info,
28
+ } ) ) ;
29
+
30
+ // Forward all chunks to the new recording stream.
31
+ new_recording. send_chunks ( store. iter_chunks ( ) . map ( |chunk| ( * * chunk) . clone ( ) ) ) ;
32
+ }
33
+
34
+ Ok ( ( ) )
35
+ }
Original file line number Diff line number Diff line change @@ -101,7 +101,6 @@ features = [
101
101
]
102
102
"concepts/send_recording" = [ # No output
103
103
" cpp" ,
104
- " rust" ,
105
104
]
106
105
"concepts/static/log_static" = [ # pseudo-code
107
106
" py" ,
You can’t perform that action at this time.
0 commit comments