Struct rerun::RecordingStreamBuilder

source ·
pub struct RecordingStreamBuilder { /* private fields */ }
Expand description

Construct a RecordingStream.

let rec = RecordingStreamBuilder::new("rerun_example_app").save("my_recording.rrd")?;

Implementations§

source§

impl RecordingStreamBuilder

source

pub fn new(application_id: impl Into<ApplicationId>) -> RecordingStreamBuilder

Create a new RecordingStreamBuilder with the given ApplicationId.

The ApplicationId is usually the name of your app.

let rec = RecordingStreamBuilder::new("rerun_example_app").save("my_recording.rrd")?;
source

pub fn default_enabled(self, default_enabled: bool) -> RecordingStreamBuilder

Set whether or not Rerun is enabled by default.

If the RERUN environment variable is set, it will override this.

Set also: Self::enabled.

source

pub fn enabled(self, enabled: bool) -> RecordingStreamBuilder

Set whether or not Rerun is enabled.

Setting this will ignore the RERUN environment variable.

Set also: Self::default_enabled.

source

pub fn recording_id( self, recording_id: impl Into<String> ) -> RecordingStreamBuilder

Set the RecordingId for this context.

If you’re logging from multiple processes and want all the messages to end up in the same recording, you must make sure that they all set the same RecordingId using this function.

Note that many stores can share the same ApplicationId, but they all have unique RecordingIds.

The default is to use a random RecordingId.

source

pub fn store_id(self, store_id: StoreId) -> RecordingStreamBuilder

Set the StoreId for this context.

If you’re logging from multiple processes and want all the messages to end up as the same store, you must make sure they all set the same StoreId using this function.

Note that many stores can share the same ApplicationId, but they all have unique StoreIds.

The default is to use a random StoreId.

source

pub fn batcher_config( self, config: DataTableBatcherConfig ) -> RecordingStreamBuilder

Specifies the configuration of the internal data batching mechanism.

See DataTableBatcher & DataTableBatcherConfig for more information.

source

pub fn buffered(self) -> Result<RecordingStream, RecordingStreamError>

Creates a new RecordingStream that starts in a buffering state (RAM).

§Example
let rec = re_sdk::RecordingStreamBuilder::new("rerun_example_app").buffered()?;
source

pub fn memory( self ) -> Result<(RecordingStream, MemorySinkStorage), RecordingStreamError>

Creates a new RecordingStream that is pre-configured to stream the data through to a crate::log_sink::MemorySink.

§Example

let (rec, storage) = re_sdk::RecordingStreamBuilder::new("rerun_example_app").memory()?;

log_data(&rec);

let data = storage.take();
source

pub fn connect(self) -> Result<RecordingStream, RecordingStreamError>

Creates a new RecordingStream that is pre-configured to stream the data through to a remote Rerun instance.

See also Self::connect_opts if you wish to configure the TCP connection.

§Example
let rec = re_sdk::RecordingStreamBuilder::new("rerun_example_app").connect()?;
source

pub fn connect_opts( self, addr: SocketAddr, flush_timeout: Option<Duration> ) -> Result<RecordingStream, RecordingStreamError>

Creates a new RecordingStream that is pre-configured to stream the data through to a remote Rerun instance.

flush_timeout is the minimum time the TcpSink will wait during a flush before potentially dropping data. Note: Passing None here can cause a call to flush to block indefinitely if a connection cannot be established.

§Example
let rec = re_sdk::RecordingStreamBuilder::new("rerun_example_app")
    .connect_opts(re_sdk::default_server_addr(), re_sdk::default_flush_timeout())?;
source

pub fn save( self, path: impl Into<PathBuf> ) -> Result<RecordingStream, RecordingStreamError>

Creates a new RecordingStream that is pre-configured to stream the data through to an RRD file on disk.

§Example
let rec = re_sdk::RecordingStreamBuilder::new("rerun_example_app").save("my_recording.rrd")?;
source

pub fn stdout(self) -> Result<RecordingStream, RecordingStreamError>

Creates a new RecordingStream that is pre-configured to stream the data through to stdout.

If there isn’t any listener at the other end of the pipe, the RecordingStream will default back to buffered mode, in order not to break the user’s terminal.

§Example
let rec = re_sdk::RecordingStreamBuilder::new("rerun_example_app").stdout()?;
source

pub fn spawn(self) -> Result<RecordingStream, RecordingStreamError>

Spawns a new Rerun Viewer process from an executable available in PATH, then creates a new RecordingStream that is pre-configured to stream the data through to that viewer over TCP.

If a Rerun Viewer is already listening on this TCP port, the stream will be redirected to that viewer instead of starting a new one.

See also Self::spawn_opts if you wish to configure the behavior of thew Rerun process as well as the underlying TCP connection.

§Example
let rec = re_sdk::RecordingStreamBuilder::new("rerun_example_app").spawn()?;
source

pub fn spawn_opts( self, opts: &SpawnOptions, flush_timeout: Option<Duration> ) -> Result<RecordingStream, RecordingStreamError>

Spawns a new Rerun Viewer process from an executable available in PATH, then creates a new RecordingStream that is pre-configured to stream the data through to that viewer over TCP.

If a Rerun Viewer is already listening on this TCP port, the stream will be redirected to that viewer instead of starting a new one.

The behavior of the spawned Viewer can be configured via opts. If you’re fine with the default behavior, refer to the simpler Self::spawn.

flush_timeout is the minimum time the TcpSink will wait during a flush before potentially dropping data. Note: Passing None here can cause a call to flush to block indefinitely if a connection cannot be established.

§Example
let rec = re_sdk::RecordingStreamBuilder::new("rerun_example_app")
    .spawn_opts(&re_sdk::SpawnOptions::default(), re_sdk::default_flush_timeout())?;
source

pub fn into_args(self) -> (bool, StoreInfo, DataTableBatcherConfig)

Returns whether or not logging is enabled, a StoreInfo and the associated batcher configuration.

This can be used to then construct a RecordingStream manually using RecordingStream::new.

Trait Implementations§

source§

impl Debug for RecordingStreamBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.