pub struct Pinhole {
pub image_from_camera: Option<SerializedComponentBatch>,
pub resolution: Option<SerializedComponentBatch>,
pub camera_xyz: Option<SerializedComponentBatch>,
pub child_frame: Option<SerializedComponentBatch>,
pub parent_frame: Option<SerializedComponentBatch>,
pub image_plane_distance: Option<SerializedComponentBatch>,
pub color: Option<SerializedComponentBatch>,
pub line_width: Option<SerializedComponentBatch>,
}Expand description
Archetype: Camera perspective projection (a.k.a. intrinsics).
If archetypes::Transform3D is logged for the same child/parent relationship (e.g. for the camera extrinsics), it takes precedence over archetypes::Pinhole.
If you use named transform frames via the child_frame and parent_frame fields, you don’t have to use archetypes::CoordinateFrame
as it is the case with other visualizations: for any entity with an archetypes::Pinhole the viewer will always visualize it
directly without needing a archetypes::CoordinateFrame to refer to the pinhole’s child/parent frame.
§Examples
§Simple pinhole camera
use ndarray::{Array, ShapeBuilder as _};
use rand::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rec = rerun::RecordingStreamBuilder::new("rerun_example_pinhole").spawn()?;
let mut image = Array::<u8, _>::default((3, 3, 3).f());
let mut rng = rand::rngs::SmallRng::seed_from_u64(42);
image.map_inplace(|x| *x = rng.random());
rec.log(
"world/image",
&rerun::Pinhole::from_focal_length_and_resolution([3., 3.], [3., 3.]),
)?;
rec.log(
"world/image",
&rerun::Image::from_color_model_and_tensor(rerun::ColorModel::RGB, image)?,
)?;
Ok(())
}
§Perspective pinhole camera
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rec = rerun::RecordingStreamBuilder::new("rerun_example_pinhole_perspective").spawn()?;
let fov_y = std::f32::consts::FRAC_PI_4;
let aspect_ratio = 1.7777778;
rec.log(
"world/cam",
&rerun::Pinhole::from_fov_and_aspect_ratio(fov_y, aspect_ratio)
.with_camera_xyz(rerun::components::ViewCoordinates::RUB)
.with_image_plane_distance(0.1)
.with_color(rerun::Color::from_rgb(255, 128, 0))
.with_line_width(0.003),
)?;
rec.log(
"world/points",
&rerun::Points3D::new([(0.0, 0.0, -0.5), (0.1, 0.1, -0.5), (-0.1, -0.1, -0.5)])
.with_radii([0.025]),
)?;
Ok(())
}
Fields§
§image_from_camera: Option<SerializedComponentBatch>Camera projection, from image coordinates to view coordinates.
Any update to this field will reset all other transform properties that aren’t changed in the same log call or send_columns row.
resolution: Option<SerializedComponentBatch>Pixel resolution (usually integers) of child image space. Width and height.
Example:
[1920.0, 1440.0]image_from_camera project onto the space spanned by (0,0) and resolution - 1.
Any update to this field will reset all other transform properties that aren’t changed in the same log call or send_columns row.
camera_xyz: Option<SerializedComponentBatch>Sets the view coordinates for the camera.
All common values are available as constants on the components::ViewCoordinates class.
The default is ViewCoordinates::RDF, i.e. X=Right, Y=Down, Z=Forward, and this is also the recommended setting.
This means that the camera frustum will point along the positive Z axis of the parent space,
and the cameras “up” direction will be along the negative Y axis of the parent space.
The camera frustum will point whichever axis is set to F (or the opposite of B).
When logging a depth image under this entity, this is the direction the point cloud will be projected.
With RDF, the default forward is +Z.
The frustum’s “up” direction will be whichever axis is set to U (or the opposite of D).
This will match the negative Y direction of pixel space (all images are assumed to have xyz=RDF).
With RDF, the default is up is -Y.
The frustum’s “right” direction will be whichever axis is set to R (or the opposite of L).
This will match the positive X direction of pixel space (all images are assumed to have xyz=RDF).
With RDF, the default right is +x.
Other common formats are RUB (X=Right, Y=Up, Z=Back) and FLU (X=Forward, Y=Left, Z=Up).
NOTE: setting this to something else than RDF (the default) will change the orientation of the camera frustum,
and make the pinhole matrix not match up with the coordinate system of the pinhole entity.
The pinhole matrix (the image_from_camera argument) always project along the third (Z) axis,
but will be re-oriented to project along the forward axis of the camera_xyz argument.
child_frame: Option<SerializedComponentBatch>The child frame this transform transforms from.
The entity at which the transform relationship of any given child frame is specified mustn’t change over time, but is allowed to be different for static time.
E.g. if you specified the child frame "robot_arm" on an entity named "my_transforms", you may not log transforms
with the child frame "robot_arm" on any other entity than "my_transforms" unless one of them was logged with static time.
If not specified, this is set to the implicit transform frame of the current entity path.
This means that if a archetypes::Transform3D is set on an entity called /my/entity/path then this will default to tf#/my/entity/path.
To set the frame an entity is part of see archetypes::CoordinateFrame.
Any update to this field will reset all other transform properties that aren’t changed in the same log call or send_columns row.
parent_frame: Option<SerializedComponentBatch>The parent frame this transform transforms into.
If not specified, this is set to the implicit transform frame of the current entity path’s parent.
This means that if a archetypes::Transform3D is set on an entity called /my/entity/path then this will default to tf#/my/entity.
To set the frame an entity is part of see archetypes::CoordinateFrame.
Any update to this field will reset all other transform properties that aren’t changed in the same log call or send_columns row.
image_plane_distance: Option<SerializedComponentBatch>The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
This is only used for visualization purposes, and does not affect the projection itself.
color: Option<SerializedComponentBatch>Color of the camera wireframe.
line_width: Option<SerializedComponentBatch>Width of the camera wireframe lines.
Implementations§
Source§impl Pinhole
impl Pinhole
Sourcepub fn descriptor_image_from_camera() -> ComponentDescriptor
pub fn descriptor_image_from_camera() -> ComponentDescriptor
Returns the ComponentDescriptor for Self::image_from_camera.
The corresponding component is crate::components::PinholeProjection.
Sourcepub fn descriptor_resolution() -> ComponentDescriptor
pub fn descriptor_resolution() -> ComponentDescriptor
Returns the ComponentDescriptor for Self::resolution.
The corresponding component is crate::components::Resolution.
Sourcepub fn descriptor_camera_xyz() -> ComponentDescriptor
pub fn descriptor_camera_xyz() -> ComponentDescriptor
Returns the ComponentDescriptor for Self::camera_xyz.
The corresponding component is crate::components::ViewCoordinates.
Sourcepub fn descriptor_child_frame() -> ComponentDescriptor
pub fn descriptor_child_frame() -> ComponentDescriptor
Returns the ComponentDescriptor for Self::child_frame.
The corresponding component is crate::components::TransformFrameId.
Sourcepub fn descriptor_parent_frame() -> ComponentDescriptor
pub fn descriptor_parent_frame() -> ComponentDescriptor
Returns the ComponentDescriptor for Self::parent_frame.
The corresponding component is crate::components::TransformFrameId.
Sourcepub fn descriptor_image_plane_distance() -> ComponentDescriptor
pub fn descriptor_image_plane_distance() -> ComponentDescriptor
Returns the ComponentDescriptor for Self::image_plane_distance.
The corresponding component is crate::components::ImagePlaneDistance.
Sourcepub fn descriptor_color() -> ComponentDescriptor
pub fn descriptor_color() -> ComponentDescriptor
Returns the ComponentDescriptor for Self::color.
The corresponding component is crate::components::Color.
Sourcepub fn descriptor_line_width() -> ComponentDescriptor
pub fn descriptor_line_width() -> ComponentDescriptor
Returns the ComponentDescriptor for Self::line_width.
The corresponding component is crate::components::Radius.
Source§impl Pinhole
impl Pinhole
Sourcepub const NUM_COMPONENTS: usize = 8usize
pub const NUM_COMPONENTS: usize = 8usize
The total number of components in the archetype: 1 required, 1 recommended, 6 optional
Source§impl Pinhole
impl Pinhole
Sourcepub fn new(image_from_camera: impl Into<PinholeProjection>) -> Pinhole
pub fn new(image_from_camera: impl Into<PinholeProjection>) -> Pinhole
Create a new Pinhole.
Sourcepub fn update_fields() -> Pinhole
pub fn update_fields() -> Pinhole
Update only some specific fields of a Pinhole.
Sourcepub fn clear_fields() -> Pinhole
pub fn clear_fields() -> Pinhole
Clear all the fields of a Pinhole.
Sourcepub fn columns<I>(
self,
_lengths: I,
) -> Result<impl Iterator<Item = SerializedComponentColumn>, SerializationError>
pub fn columns<I>( self, _lengths: I, ) -> Result<impl Iterator<Item = SerializedComponentColumn>, SerializationError>
Partitions the component data into multiple sub-batches.
Specifically, this transforms the existing SerializedComponentBatches data into SerializedComponentColumns
instead, via SerializedComponentBatch::partitioned.
This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.
The specified lengths must sum to the total length of the component batch.
Sourcepub fn columns_of_unit_batches(
self,
) -> Result<impl Iterator<Item = SerializedComponentColumn>, SerializationError>
pub fn columns_of_unit_batches( self, ) -> Result<impl Iterator<Item = SerializedComponentColumn>, SerializationError>
Helper to partition the component data into unit-length sub-batches.
This is semantically similar to calling Self::columns with std::iter::take(1).repeat(n),
where n is automatically guessed.
Sourcepub fn with_image_from_camera(
self,
image_from_camera: impl Into<PinholeProjection>,
) -> Pinhole
pub fn with_image_from_camera( self, image_from_camera: impl Into<PinholeProjection>, ) -> Pinhole
Camera projection, from image coordinates to view coordinates.
Any update to this field will reset all other transform properties that aren’t changed in the same log call or send_columns row.
Sourcepub fn with_many_image_from_camera(
self,
image_from_camera: impl IntoIterator<Item = impl Into<PinholeProjection>>,
) -> Pinhole
pub fn with_many_image_from_camera( self, image_from_camera: impl IntoIterator<Item = impl Into<PinholeProjection>>, ) -> Pinhole
This method makes it possible to pack multiple crate::components::PinholeProjection in a single component batch.
This only makes sense when used in conjunction with Self::columns. Self::with_image_from_camera should
be used when logging a single row’s worth of data.
Sourcepub fn with_resolution(self, resolution: impl Into<Resolution>) -> Pinhole
pub fn with_resolution(self, resolution: impl Into<Resolution>) -> Pinhole
Pixel resolution (usually integers) of child image space. Width and height.
Example:
[1920.0, 1440.0]image_from_camera project onto the space spanned by (0,0) and resolution - 1.
Any update to this field will reset all other transform properties that aren’t changed in the same log call or send_columns row.
Sourcepub fn with_many_resolution(
self,
resolution: impl IntoIterator<Item = impl Into<Resolution>>,
) -> Pinhole
pub fn with_many_resolution( self, resolution: impl IntoIterator<Item = impl Into<Resolution>>, ) -> Pinhole
This method makes it possible to pack multiple crate::components::Resolution in a single component batch.
This only makes sense when used in conjunction with Self::columns. Self::with_resolution should
be used when logging a single row’s worth of data.
Sourcepub fn with_camera_xyz(self, camera_xyz: impl Into<ViewCoordinates>) -> Pinhole
pub fn with_camera_xyz(self, camera_xyz: impl Into<ViewCoordinates>) -> Pinhole
Sets the view coordinates for the camera.
All common values are available as constants on the components::ViewCoordinates class.
The default is ViewCoordinates::RDF, i.e. X=Right, Y=Down, Z=Forward, and this is also the recommended setting.
This means that the camera frustum will point along the positive Z axis of the parent space,
and the cameras “up” direction will be along the negative Y axis of the parent space.
The camera frustum will point whichever axis is set to F (or the opposite of B).
When logging a depth image under this entity, this is the direction the point cloud will be projected.
With RDF, the default forward is +Z.
The frustum’s “up” direction will be whichever axis is set to U (or the opposite of D).
This will match the negative Y direction of pixel space (all images are assumed to have xyz=RDF).
With RDF, the default is up is -Y.
The frustum’s “right” direction will be whichever axis is set to R (or the opposite of L).
This will match the positive X direction of pixel space (all images are assumed to have xyz=RDF).
With RDF, the default right is +x.
Other common formats are RUB (X=Right, Y=Up, Z=Back) and FLU (X=Forward, Y=Left, Z=Up).
NOTE: setting this to something else than RDF (the default) will change the orientation of the camera frustum,
and make the pinhole matrix not match up with the coordinate system of the pinhole entity.
The pinhole matrix (the image_from_camera argument) always project along the third (Z) axis,
but will be re-oriented to project along the forward axis of the camera_xyz argument.
Sourcepub fn with_many_camera_xyz(
self,
camera_xyz: impl IntoIterator<Item = impl Into<ViewCoordinates>>,
) -> Pinhole
pub fn with_many_camera_xyz( self, camera_xyz: impl IntoIterator<Item = impl Into<ViewCoordinates>>, ) -> Pinhole
This method makes it possible to pack multiple crate::components::ViewCoordinates in a single component batch.
This only makes sense when used in conjunction with Self::columns. Self::with_camera_xyz should
be used when logging a single row’s worth of data.
Sourcepub fn with_child_frame(
self,
child_frame: impl Into<TransformFrameId>,
) -> Pinhole
pub fn with_child_frame( self, child_frame: impl Into<TransformFrameId>, ) -> Pinhole
The child frame this transform transforms from.
The entity at which the transform relationship of any given child frame is specified mustn’t change over time, but is allowed to be different for static time.
E.g. if you specified the child frame "robot_arm" on an entity named "my_transforms", you may not log transforms
with the child frame "robot_arm" on any other entity than "my_transforms" unless one of them was logged with static time.
If not specified, this is set to the implicit transform frame of the current entity path.
This means that if a archetypes::Transform3D is set on an entity called /my/entity/path then this will default to tf#/my/entity/path.
To set the frame an entity is part of see archetypes::CoordinateFrame.
Any update to this field will reset all other transform properties that aren’t changed in the same log call or send_columns row.
Sourcepub fn with_many_child_frame(
self,
child_frame: impl IntoIterator<Item = impl Into<TransformFrameId>>,
) -> Pinhole
pub fn with_many_child_frame( self, child_frame: impl IntoIterator<Item = impl Into<TransformFrameId>>, ) -> Pinhole
This method makes it possible to pack multiple crate::components::TransformFrameId in a single component batch.
This only makes sense when used in conjunction with Self::columns. Self::with_child_frame should
be used when logging a single row’s worth of data.
Sourcepub fn with_parent_frame(
self,
parent_frame: impl Into<TransformFrameId>,
) -> Pinhole
pub fn with_parent_frame( self, parent_frame: impl Into<TransformFrameId>, ) -> Pinhole
The parent frame this transform transforms into.
If not specified, this is set to the implicit transform frame of the current entity path’s parent.
This means that if a archetypes::Transform3D is set on an entity called /my/entity/path then this will default to tf#/my/entity.
To set the frame an entity is part of see archetypes::CoordinateFrame.
Any update to this field will reset all other transform properties that aren’t changed in the same log call or send_columns row.
Sourcepub fn with_many_parent_frame(
self,
parent_frame: impl IntoIterator<Item = impl Into<TransformFrameId>>,
) -> Pinhole
pub fn with_many_parent_frame( self, parent_frame: impl IntoIterator<Item = impl Into<TransformFrameId>>, ) -> Pinhole
This method makes it possible to pack multiple crate::components::TransformFrameId in a single component batch.
This only makes sense when used in conjunction with Self::columns. Self::with_parent_frame should
be used when logging a single row’s worth of data.
Sourcepub fn with_image_plane_distance(
self,
image_plane_distance: impl Into<ImagePlaneDistance>,
) -> Pinhole
pub fn with_image_plane_distance( self, image_plane_distance: impl Into<ImagePlaneDistance>, ) -> Pinhole
The distance from the camera origin to the image plane when the projection is shown in a 3D viewer.
This is only used for visualization purposes, and does not affect the projection itself.
Sourcepub fn with_many_image_plane_distance(
self,
image_plane_distance: impl IntoIterator<Item = impl Into<ImagePlaneDistance>>,
) -> Pinhole
pub fn with_many_image_plane_distance( self, image_plane_distance: impl IntoIterator<Item = impl Into<ImagePlaneDistance>>, ) -> Pinhole
This method makes it possible to pack multiple crate::components::ImagePlaneDistance in a single component batch.
This only makes sense when used in conjunction with Self::columns. Self::with_image_plane_distance should
be used when logging a single row’s worth of data.
Sourcepub fn with_color(self, color: impl Into<Color>) -> Pinhole
pub fn with_color(self, color: impl Into<Color>) -> Pinhole
Color of the camera wireframe.
Sourcepub fn with_many_color(
self,
color: impl IntoIterator<Item = impl Into<Color>>,
) -> Pinhole
pub fn with_many_color( self, color: impl IntoIterator<Item = impl Into<Color>>, ) -> Pinhole
This method makes it possible to pack multiple crate::components::Color in a single component batch.
This only makes sense when used in conjunction with Self::columns. Self::with_color should
be used when logging a single row’s worth of data.
Sourcepub fn with_line_width(self, line_width: impl Into<Radius>) -> Pinhole
pub fn with_line_width(self, line_width: impl Into<Radius>) -> Pinhole
Width of the camera wireframe lines.
Sourcepub fn with_many_line_width(
self,
line_width: impl IntoIterator<Item = impl Into<Radius>>,
) -> Pinhole
pub fn with_many_line_width( self, line_width: impl IntoIterator<Item = impl Into<Radius>>, ) -> Pinhole
This method makes it possible to pack multiple crate::components::Radius in a single component batch.
This only makes sense when used in conjunction with Self::columns. Self::with_line_width should
be used when logging a single row’s worth of data.
Source§impl Pinhole
impl Pinhole
Sourcepub const DEFAULT_CAMERA_XYZ: ViewCoordinates = ViewCoordinates::RDF
pub const DEFAULT_CAMERA_XYZ: ViewCoordinates = ViewCoordinates::RDF
Camera orientation used when there’s no camera orientation explicitly logged.
- x pointing right
- y pointing down
- z pointing into the image plane (this is convenient for reading out a depth image which has typically positive z values)
Sourcepub fn from_focal_length_and_resolution(
focal_length: impl Into<Vec2D>,
resolution: impl Into<Vec2D>,
) -> Pinhole
pub fn from_focal_length_and_resolution( focal_length: impl Into<Vec2D>, resolution: impl Into<Vec2D>, ) -> Pinhole
Creates a pinhole from the camera focal length and resolution, both specified in pixels.
The focal length is the diagonal of the projection matrix. Set the same value for x & y value for symmetric cameras, or two values for anamorphic cameras.
Assumes the principal point to be in the middle of the sensor.
Sourcepub fn from_fov_and_aspect_ratio(fov_y: f32, aspect_ratio: f32) -> Pinhole
pub fn from_fov_and_aspect_ratio(fov_y: f32, aspect_ratio: f32) -> Pinhole
Creates a pinhole from the camera vertical field of view (in radians) and aspect ratio (width/height).
Assumes the principal point to be in the middle of the sensor.
Sourcepub fn with_principal_point(self, principal_point: impl Into<Vec2D>) -> Pinhole
pub fn with_principal_point(self, principal_point: impl Into<Vec2D>) -> Pinhole
Principal point of the pinhole camera, i.e. the intersection of the optical axis and the image plane.
see definition of intrinsic matrix
Sourcepub fn image_from_camera_from_arrow(
&self,
) -> Result<PinholeProjection, DeserializationError>
pub fn image_from_camera_from_arrow( &self, ) -> Result<PinholeProjection, DeserializationError>
Deserializes the pinhole projection from the image_from_camera field.
Returns re_types_core::DeserializationError::MissingData if the component is not present.
Sourcepub fn resolution_from_arrow(&self) -> Result<Resolution, DeserializationError>
pub fn resolution_from_arrow(&self) -> Result<Resolution, DeserializationError>
Deserializes the resolution from the resolution field.
Returns re_types_core::DeserializationError::MissingData if the component is not present.
Trait Implementations§
Source§impl Archetype for Pinhole
impl Archetype for Pinhole
Source§fn name() -> ArchetypeName
fn name() -> ArchetypeName
rerun.archetypes.Points2D.Source§fn display_name() -> &'static str
fn display_name() -> &'static str
Source§fn required_components() -> Cow<'static, [ComponentDescriptor]>
fn required_components() -> Cow<'static, [ComponentDescriptor]>
Source§fn recommended_components() -> Cow<'static, [ComponentDescriptor]>
fn recommended_components() -> Cow<'static, [ComponentDescriptor]>
Source§fn optional_components() -> Cow<'static, [ComponentDescriptor]>
fn optional_components() -> Cow<'static, [ComponentDescriptor]>
Source§fn all_components() -> Cow<'static, [ComponentDescriptor]>
fn all_components() -> Cow<'static, [ComponentDescriptor]>
Source§fn from_arrow_components(
arrow_data: impl IntoIterator<Item = (ComponentDescriptor, Arc<dyn Array>)>,
) -> Result<Pinhole, DeserializationError>
fn from_arrow_components( arrow_data: impl IntoIterator<Item = (ComponentDescriptor, Arc<dyn Array>)>, ) -> Result<Pinhole, DeserializationError>
ComponentDescriptors, deserializes them
into this archetype. Read moreSource§fn all_component_identifiers() -> impl Iterator<Item = ComponentIdentifier>
fn all_component_identifiers() -> impl Iterator<Item = ComponentIdentifier>
Self::all_components to return all component identifiers.Source§fn from_arrow(
data: impl IntoIterator<Item = (Field, Arc<dyn Array>)>,
) -> Result<Self, DeserializationError>where
Self: Sized,
fn from_arrow(
data: impl IntoIterator<Item = (Field, Arc<dyn Array>)>,
) -> Result<Self, DeserializationError>where
Self: Sized,
Source§impl AsComponents for Pinhole
impl AsComponents for Pinhole
Source§fn as_serialized_batches(&self) -> Vec<SerializedComponentBatch>
fn as_serialized_batches(&self) -> Vec<SerializedComponentBatch>
SerializedComponentBatches. Read moreSource§impl SizeBytes for Pinhole
impl SizeBytes for Pinhole
Source§fn heap_size_bytes(&self) -> u64
fn heap_size_bytes(&self) -> u64
self uses on the heap. Read moreSource§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
self in bytes, accounting for both stack and heap space.Source§fn stack_size_bytes(&self) -> u64
fn stack_size_bytes(&self) -> u64
self on the stack, in bytes. Read moreSource§impl VisualizableArchetype for Pinhole
impl VisualizableArchetype for Pinhole
Source§fn visualizer(&self) -> Visualizer
fn visualizer(&self) -> Visualizer
impl ArchetypeReflectionMarker for Pinhole
impl StructuralPartialEq for Pinhole
Auto Trait Implementations§
impl Freeze for Pinhole
impl !RefUnwindSafe for Pinhole
impl Send for Pinhole
impl Sync for Pinhole
impl Unpin for Pinhole
impl UnsafeUnpin for Pinhole
impl !UnwindSafe for Pinhole
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.