Skip to main content

Reader

Struct Reader 

Source
pub struct Reader {
    pub metadata: Metadata,
    pub connections: Vec<TopicConnection>,
    /* private fields */
}

Fields§

§metadata: Metadata§connections: Vec<TopicConnection>

Implementations§

Source§

impl Reader

The Reader struct provides an interface for reading message data from a ROS bag file.

The Reader initializes with the path to a ROS bag directory and reads metadata and message data from the storage. It supports filtering messages by time and handling each message through a user-defined function.

§Errors

  • Returns an error if the ROS bag version is not supported.
  • Returns an error if the compression mode is not supported.
  • Returns an error if a non-CDR serialization format is found in any topic.
  • Returns an error if the storage identifier is not ‘sqlite3’.

§Note

  • This struct assumes that the ROS bag files are in sqlite3 format.
  • The handle_messages method allows for processing of individual messages.
Source

pub fn new(path: impl AsRef<Path>) -> Result<Self>

Source

pub fn open(&mut self) -> Result<()>

Source

pub fn handle_messages( &mut self, handle_func: impl Fn((i64, i64, Vec<u8>)) -> Result<()>, start: Option<i64>, stop: Option<i64>, ) -> Result<()>

Source

pub fn duration(&self) -> i64

Source

pub fn start_time(&self) -> i64

Source

pub fn end_time(&self) -> i64

Source

pub fn message_count(&self) -> i32

Source

pub fn compression_format(&self) -> String

Source

pub fn compression_mode(&self) -> Option<String>

Source

pub fn topics(&self) -> HashMap<String, TopicInfo>

Source

pub fn ros_distro(&self) -> String

Auto Trait Implementations§

§

impl !RefUnwindSafe for Reader

§

impl !Sync for Reader

§

impl !UnwindSafe for Reader

§

impl Freeze for Reader

§

impl Send for Reader

§

impl Unpin for Reader

§

impl UnsafeUnpin for Reader

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

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>,

Source§

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.