pub struct PointCloud2MsgBuilder { /* private fields */ }Expand description
Creating a PointCloud2Msg with the builder pattern to avoid invalid states.
Implementations§
Source§impl PointCloud2MsgBuilder
impl PointCloud2MsgBuilder
pub fn new() -> Self
pub fn header(self, header: HeaderMsg) -> Self
pub fn width(self, width: u32) -> Self
pub fn fields(self, fields: Vec<PointFieldMsg>) -> Self
pub fn endian(self, is_big_endian: bool) -> Self
pub fn point_step(self, point_step: u32) -> Self
pub fn row_step(self, row_step: u32) -> Self
pub fn data(self, data: Vec<u8>) -> Self
pub fn dense(self, is_dense: bool) -> Self
Sourcepub fn build(self) -> Result<PointCloud2Msg, MsgConversionError>
pub fn build(self) -> Result<PointCloud2Msg, MsgConversionError>
Build the PointCloud2Msg from the builder.
§Errors
Returns an error if the fields are empty, the field count is not 1, the field format is invalid, the data length does not match the point step, or the field size is too large.
Trait Implementations§
Source§impl Clone for PointCloud2MsgBuilder
impl Clone for PointCloud2MsgBuilder
Source§fn clone(&self) -> PointCloud2MsgBuilder
fn clone(&self) -> PointCloud2MsgBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PointCloud2MsgBuilder
impl Debug for PointCloud2MsgBuilder
Source§impl Default for PointCloud2MsgBuilder
impl Default for PointCloud2MsgBuilder
Source§fn default() -> PointCloud2MsgBuilder
fn default() -> PointCloud2MsgBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PointCloud2MsgBuilder
impl RefUnwindSafe for PointCloud2MsgBuilder
impl Send for PointCloud2MsgBuilder
impl Sync for PointCloud2MsgBuilder
impl Unpin for PointCloud2MsgBuilder
impl UnwindSafe for PointCloud2MsgBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.