Skip to main content

MeshGraph

Struct MeshGraph 

Source
pub struct MeshGraph {
    pub bvh: Bvh,
    pub bvh_workspace: BvhWorkspace,
    pub index_to_face_id: HashMap<u32, FaceId>,
    pub next_index: u32,
    pub vertices: SlotMap<VertexId, Vertex>,
    pub halfedges: SlotMap<HalfedgeId, Halfedge>,
    pub faces: SlotMap<FaceId, Face>,
    pub positions: SecondaryMap<VertexId, Vec3>,
    pub vertex_normals: Option<SecondaryMap<VertexId, Vec3>>,
    pub outgoing_halfedges: SecondaryMap<VertexId, Vec<HalfedgeId>>,
}
Expand description

Halfedge data structure for representing triangle meshes.

Please see the crate documentation for more information.

Fields§

§bvh: Bvh

Acceleration structure for fast spatial queries. Uses parry3d’s Bvh to implement some of parry3d’s spatial queries.

§bvh_workspace: BvhWorkspace

Used in conjunction with the BVH to accelerate spatial queries.

§index_to_face_id: HashMap<u32, FaceId>

Used to map indices stored in the BVH to face IDs.

§next_index: u32

Used to compute the next index for a new face

§vertices: SlotMap<VertexId, Vertex>

Maps vertex IDs to their corresponding graph node

§halfedges: SlotMap<HalfedgeId, Halfedge>

Maps halfedge IDs to their corresponding graph node

§faces: SlotMap<FaceId, Face>

Maps face IDs to their corresponding graph node

§positions: SecondaryMap<VertexId, Vec3>

Maps vertex IDs to their corresponding positions

§vertex_normals: Option<SecondaryMap<VertexId, Vec3>>

Maps vertex IDs to their corresponding normals

§outgoing_halfedges: SecondaryMap<VertexId, Vec<HalfedgeId>>

Maps vertex IDs to their corresponding outgoing halfedges (not in any particular order)

Implementations§

Source§

impl MeshGraph

Source

pub fn boundary_he(&self, he_id: HalfedgeId) -> Option<HalfedgeId>

Return the halfedge or it’s twin depending on which one is boundary, or None if both are not boundary.

Source

pub fn boundary_vertex_order( &mut self, v_id1: VertexId, v_id2: VertexId, ) -> [VertexId; 2]

Returns the vertex order of the boundary halfedge between two vertices. Useful when adding faces on boundaries.

If the edge is not boundary, it always returns [v_id2, v_id1].

Source

pub fn halfedge_from_to( &self, start_vertex_id: VertexId, end_vertex_id: VertexId, ) -> Option<HalfedgeId>

Returns the halfedge from the start vertex to the end vertex, if it exists. None otherwise.

Source

pub fn face_with_vertices( &self, v_id1: VertexId, v_id2: VertexId, v_id3: VertexId, ) -> Option<FaceId>

Returns the face with the given vertices, if it exists. None otherwise.

Source§

impl MeshGraph

Source

pub fn add_or_get_edge( &mut self, start_vertex_id: VertexId, end_vertex_id: VertexId, ) -> AddOrGetEdge

Inserts a pair of halfedges and connects them to the given vertices (from and to the halfedge) and each other as twins. If the edge already exists or partially exists, it returns the existing edge while creating any missing halfedges.

See also [add_edge].

Source

pub fn add_edge( &mut self, start_vertex: VertexId, end_vertex: VertexId, ) -> AddEdge

Inserts a pair of halfedges and connects them to the given vertices (from and to the halfedge) and each other as twins. This creates two halfedges wether the vertices already have an edge between them or not.

If you don’t want this, consider using [add_or_get_edge] instead.

Source

pub fn add_halfedge( &mut self, start_vertex: VertexId, end_vertex: VertexId, ) -> HalfedgeId

Inserts a halfedge into the mesh graph. It only connects the halfedge to the given end vertex but not the reverse. It also doesn’t do any other connections.

It does insert into self.outgoing_halfedges.

Use [insert_or_get_edge] instead of this when you can to lower the chance of creating an invalid graph.

Source§

impl MeshGraph

Source

pub fn add_face_from_positions(&mut self, a: Vec3, b: Vec3, c: Vec3) -> AddFace

Source

pub fn add_face_from_halfedge_and_position( &mut self, he_id: HalfedgeId, opposite_vertex_pos: Vec3, ) -> Option<AddFace>

Returns None when an edge already has two faces

Source

pub fn add_face_from_halfedge_and_vertex( &mut self, he_id: HalfedgeId, vertex_id: VertexId, ) -> Option<AddFace>

Returns None when the edge described by he_id already has two faces

Source

pub fn add_face_from_vertices( &mut self, v_id1: VertexId, v_id2: VertexId, v_id3: VertexId, ) -> AddFace

Creates a face from three vertices.

Source

pub fn add_face_from_halfedges( &mut self, he_id1: HalfedgeId, he_id2: HalfedgeId, ) -> Option<AddFace>

Creates a face from two halfedges.

Source

pub fn add_face( &mut self, he1_id: HalfedgeId, he2_id: HalfedgeId, he3_id: HalfedgeId, ) -> FaceId

Inserts a face into the mesh graph. It connects the halfedges to the face and the face to the first halfedge. Additionally it connects the halfedges’ next loop around the face.

Source§

impl MeshGraph

Source

pub fn add_vertex(&mut self, position: Vec3) -> VertexId

Inserts a vertex and it’s position into the mesh graph. It doesn’t do any connections.

Source§

impl MeshGraph

Source

pub fn make_outgoing_halfedge_boundary_if_possible( &mut self, vertex_id: VertexId, )

Ensure that if one of the outgoing halfedges of this vertex is a boundary halfedge, then it will be the one in [Vertex::outgoing_halfedge].

The method [Vertex::is_boundary] relies on this.

Source

pub fn make_all_outgoing_halfedges_boundary_if_possible(&mut self)

Ensure that if one of the outgoing halfedges of any vertex is a boundary halfedge, then it will be the one in [Vertex::outgoing_halfedge].

The method [Vertex::is_boundary] relies on this.

Source§

impl MeshGraph

Source

pub fn make_vertex_neighborhood_manifold( &mut self, vertex_id: VertexId, ) -> VertexNeighborhoodCleanup

Ensure that the neighborhood of a vertex is manifold.

It removes flaps (two neighboring coincident triangles) and splits the given vertex in two if there are non-neighboring degenerate triangles or edges.

See Freestyle: Sculpting meshes with self-adaptive topology DOI 10.1016/j.cag.2011.03.033 Chapters 3.2 and 5.1

Source

pub fn make_vertex_neighborhood_manifold_inner( &mut self, vertex_id: VertexId, removed_vertices: &mut Vec<VertexId>, removed_halfedges: &mut Vec<HalfedgeId>, removed_faces: &mut Vec<FaceId>, ) -> Option<Vec<VertexId>>

Source

pub fn remove_degenerate_faces( &mut self, vertex_id: VertexId, removed_vertices: &mut Vec<VertexId>, removed_halfedges: &mut Vec<HalfedgeId>, removed_faces: &mut Vec<FaceId>, ) -> Option<VertexId>

Source§

impl MeshGraph

Source

pub fn faces_share_edge(&self, face_id1: FaceId, face_id2: FaceId) -> bool

Test if two faces have at least one halfedge in common.

Source

pub fn faces_share_all_vertices( &self, face_id1: FaceId, face_id2: FaceId, ) -> bool

Test if two faces share all vertices.

Source

pub fn halfedges_share_all_vertices( &self, halfedge_id1: HalfedgeId, halfedge_id2: HalfedgeId, ) -> bool

Test if two halfedges share all vertices.

Source

pub fn vertices_share_position( &self, vertex_id1: VertexId, vertex_id2: VertexId, ) -> bool

Test if two vertices have the exact same position.

Source§

impl MeshGraph

Source

pub fn collapse_until_edges_above_min_length( &mut self, min_length_squared: f32, marked_vertices: &mut HashSet<VertexId>, )

Collapses edges until all edges have a length above the minimum length.

This will schedule necessary updates to the BVH but you have to call refit_bvh() after the operation.

Source

pub fn can_collapse_edge(&mut self, halfedge_id: HalfedgeId) -> bool

Source

pub fn collapse_edge_inner( &mut self, halfedge_id: HalfedgeId, twin_id: HalfedgeId, start_v_id: VertexId, end_v_id: VertexId, center_pos: Vec3, ) -> CollapseEdge

Source

pub fn collapse_edge(&mut self, halfedge_id: HalfedgeId) -> CollapseEdge

Collapse an edge in the mesh graph.

This moves the start vertex of the edge to the center of the edge and removes the end vertex and the adjacent and opposite faces.

It also performs a cleanup afterwards to remove flaps (faces that share the same vertices).

Returns the vertices, halfedges and faces that were removed.

Source§

impl MeshGraph

Source

pub fn flip_edge(&mut self, halfedge_id: HalfedgeId)

Flips this edge so that it represents the other diagonal described by the quad formed by the two incident triangles.

    *                    *
   / \                  / \
  /   \                / ‖ \
 /     \              /  ‖  \
* ===== *     =>     *   ‖   *
 \     /              \  ‖  /
  \   /                \ ‖ /
   \ /                  \ /
    *                    *
Source

pub fn make_twins(&mut self, he_id1: HalfedgeId, he_id2: HalfedgeId)

Makes two halfedges twins of each other. Doesn’t change anything else

Source

pub fn remove_outgoing_halfedge( &mut self, vertex_id: VertexId, halfedge_id: HalfedgeId, )

Removes the outgoing halfedge from a vertex. Doesn’t change anything else.

Source

pub fn add_outgoing_halfedge( &mut self, vertex_id: VertexId, outgoing_halfedge: HalfedgeId, )

Adds the outgoing halfedge to a vertex and overrides the vertex.outgoing_halfedge

Source

pub fn smooth_vertices(&mut self, vertices: impl IntoIterator<Item = VertexId>)

Smooths the position of the vertex by computing the average of its own and its neighbors’ positions and moving it there. Also called Laplacian Smoothing.

Source

pub fn smooth_vertex(&mut self, vertex_id: VertexId)

Smooth the position of the vertex by computing the average of its own and its neighbors’ positions and moving it there. Also called Laplacian Smoothing.

Note: If you want to smooth multiple vertices, use the smooth_vertices method instead of calling this method multiple times.

Source§

impl MeshGraph

Source

pub fn merge_vertices_one_rings( &mut self, vertex_id1: VertexId, vertex_id2: VertexId, flip_threshold_sqr: f32, marked_halfedges: &mut HashSet<HalfedgeId>, marked_vertices: &mut HashSet<VertexId>, ) -> MergeVerticesOneRing

Merge two vertices by connecting their 1-rings.

The vertices are deleted on top of everything that is returned in the removed_... fields.

See Freestyle: Sculpting meshes with self-adaptive topology DOI 10.1016/j.cag.2011.03.033 Chapters 3.2 and 5.1

Source§

impl MeshGraph

Source

pub fn triangle(&self, shape_id: u32) -> Triangle

Source§

impl MeshGraph

Source

pub fn remove_face( &mut self, face_id: FaceId, ) -> (Vec<VertexId>, Vec<HalfedgeId>)

Deletes a face from the mesh graph.

It also deletes the vertices and halfedges that are no longer connected to any other faces.

Returns the ids of the removed vertices and halfedges.

Source

pub fn remove_only_vertex(&mut self, vertex_id: VertexId)

Deletes only a vertex, without deleting any faces or halfedges connected to it.

Source

pub fn remove_only_halfedge(&mut self, he_id: HalfedgeId)

Deletes only a halfedge, without deleting any faces or vertices connected to it. This also doesn’t delete or update any twin

Source

pub fn remove_only_halfedge_and_twin(&mut self, he_id: HalfedgeId)

Source§

impl MeshGraph

Source

pub fn subdivide_until_edges_below_max_length( &mut self, max_length_squared: f32, marked_halfedge_ids: &mut HashSet<HalfedgeId>, marked_vertex_ids: &mut HashSet<VertexId>, )

Subdivide all edges until all of them are <= max_length. Please note that you have to provide the squared value of max_length.

This will schedule necessary updates to the QBVH but you have to call refit_bvh() after the operation.

Source

pub fn subdivide_edge( &mut self, halfedge_id: HalfedgeId, ) -> Option<SubdivideEdge>

Subdivides an edge by computing it’s center vertex. This also subdivides any adjacent triangles and makes sure everything is properly reconnected. Works only on triangle meshes.

Returns the id of the new halfedge which goes from the center vertex to the original edge’s end vertex. And also return the halfedges that are created by subdividing the adjacent faces. Only one of the two twin halfedges per face subdivision is returned. In total the number n of halfedges returned is 1 <= n <= 3. (The one from dividing the halfedge and at most 2 from dividing the two adjacent faces).

Also returns the created vertex id.

Source§

impl MeshGraph

Source

pub fn apply_quat(&mut self, quat: Quat)

Apply a quaternion rotation to the mesh graph (positions and normals).

After this you should probably call rebuild_bvh to update the bounding volume hierarchy.

Source

pub fn apply_projection(&mut self, projection: Mat4)

Apply a projection to the mesh graph (positions and normals).

After this you should probably call rebuild_bvh to update the bounding volume hierarchy.

Source

pub fn apply_transform(&mut self, transform: Mat4)

Apply a transform matrix to the mesh graph (positions and normals).

After this you should probably call rebuild_bvh to update the bounding volume hierarchy.

Source§

impl MeshGraph

Source

pub fn halfedges_map( &mut self, predicate: impl Fn(f32) -> bool, ) -> HashMap<HalfedgeId, f32>

Source§

impl MeshGraph

Source

pub fn new() -> Self

Create a new empty mesh graph

Source

pub fn triangles(vertex_positions: &[Vec3]) -> Self

Create a triangle mesh graph from vertex positions. Every three positions represent a triangle.

Vertices with the same position are merged into a single vertex.

Source

pub fn indexed_triangles( vertex_positions: &[Vec3], face_indices: &[usize], ) -> Self

Create a triangle mesh graph from vertex positions and face indices. Every chunk of three indices represents a triangle.

Source

pub fn compute_vertex_normal(&mut self, vertex_id: VertexId)

Computes the vertex normal from neighboring faces

Source

pub fn compute_vertex_normals(&mut self)

Computes the vertex normals by averaging over the computed face normals

Source

pub fn normalize_vertex_normals(&mut self)

Ensures that the vertex normals are all normalized

Source

pub fn optimize_bvh_incremental(&mut self)

Calls the optimize_incremental method of the BVH.

Source

pub fn refit_bvh(&mut self)

Recomputes the bounding boxes of the BVH. This is necessary when the mesh is modified.

Source

pub fn rebuild_bvh(&mut self)

Rebuilds the BVH from scratch

Source

pub fn rebuild_outgoing_halfedges(&mut self)

Trait Implementations§

Source§

impl Clone for MeshGraph

Source§

fn clone(&self) -> MeshGraph

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CompositeShape for MeshGraph

Source§

fn map_part_at( &self, shape_id: u32, f: &mut dyn FnMut(Option<&Pose>, &dyn Shape, Option<&dyn NormalConstraints>), )

Applies a function to one sub-shape of this composite shape. Read more
Source§

fn bvh(&self) -> &Bvh

Gets the acceleration structure of the composite shape.
Source§

impl Default for MeshGraph

Source§

fn default() -> MeshGraph

Returns the “default value” for a type. Read more
Source§

impl From<&MeshGraph> for VertexIndexBuffers

Source§

fn from(mesh_graph: &MeshGraph) -> VertexIndexBuffers

Converts to this type from the input type.
Source§

impl From<IcoSphere> for MeshGraph

Source§

fn from(isosphere: IcoSphere) -> Self

Converts to this type from the input type.
Source§

impl From<Quad> for MeshGraph

Source§

fn from(quad: Quad) -> Self

Converts to this type from the input type.
Source§

impl From<Triangle> for MeshGraph

Source§

fn from(triangle: Triangle) -> Self

Converts to this type from the input type.
Source§

impl PointQuery for MeshGraph

Source§

fn project_local_point(&self, point: Vec3, solid: bool) -> PointProjection

Projects a point on self. Read more
Source§

fn project_local_point_and_get_feature( &self, _point: Vec3, ) -> (PointProjection, FeatureId)

Projects a point on the boundary of self and returns the id of the feature the point was projected on.
Source§

fn project_local_point_with_max_dist( &self, pt: Vec3, solid: bool, max_dist: f32, ) -> Option<PointProjection>

Projects a point onto the shape, with a maximum distance limit. Read more
Source§

fn project_point_with_max_dist( &self, m: &Pose3, pt: Vec3, solid: bool, max_dist: f32, ) -> Option<PointProjection>

Projects a point on self transformed by m, unless the projection lies further than the given max distance.
Source§

fn distance_to_local_point(&self, pt: Vec3, solid: bool) -> f32

Computes the minimal distance between a point and self.
Source§

fn contains_local_point(&self, pt: Vec3) -> bool

Tests if the given point is inside of self.
Source§

fn project_point(&self, m: &Pose3, pt: Vec3, solid: bool) -> PointProjection

Projects a point on self transformed by m.
Source§

fn distance_to_point(&self, m: &Pose3, pt: Vec3, solid: bool) -> f32

Computes the minimal distance between a point and self transformed by m.
Source§

fn project_point_and_get_feature( &self, m: &Pose3, pt: Vec3, ) -> (PointProjection, FeatureId)

Projects a point on the boundary of self transformed by m and returns the id of the feature the point was projected on.
Source§

fn contains_point(&self, m: &Pose3, pt: Vec3) -> bool

Tests if the given point is inside of self transformed by m.
Source§

impl PointQueryWithLocation for MeshGraph

Source§

fn project_local_point_and_get_location_with_max_dist( &self, point: Vec3, solid: bool, max_dist: f32, ) -> Option<(PointProjection, Self::Location)>

Projects a point on self, with a maximum projection distance.

Source§

type Location = Face

Additional shape-specific projection information Read more
Source§

fn project_local_point_and_get_location( &self, point: Vec3, solid: bool, ) -> (PointProjection, Self::Location)

Projects a point on self.
Source§

fn project_point_and_get_location( &self, m: &Pose3, pt: Vec3, solid: bool, ) -> (PointProjection, Self::Location)

Projects a point on self transformed by m.
Source§

fn project_point_and_get_location_with_max_dist( &self, m: &Pose3, pt: Vec3, solid: bool, max_dist: f32, ) -> Option<(PointProjection, Self::Location)>

Projects a point on self transformed by m, with a maximum projection distance.
Source§

impl RayCast for MeshGraph

Source§

fn cast_local_ray( &self, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<f32>

Computes the time of impact between this transform shape and a ray.
Source§

fn cast_local_ray_and_get_normal( &self, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<RayIntersection>

Computes the time of impact, and normal between this transformed shape and a ray.
Source§

fn intersects_local_ray(&self, ray: &Ray, max_time_of_impact: f32) -> bool

Tests whether a ray intersects this transformed shape.
Source§

fn cast_ray( &self, m: &Pose3, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<f32>

Computes the time of impact between this transform shape and a ray.
Source§

fn cast_ray_and_get_normal( &self, m: &Pose3, ray: &Ray, max_time_of_impact: f32, solid: bool, ) -> Option<RayIntersection>

Computes the time of impact, and normal between this transformed shape and a ray.
Source§

fn intersects_ray(&self, m: &Pose3, ray: &Ray, max_time_of_impact: f32) -> bool

Tests whether a ray intersects this transformed shape.
Source§

impl TypedCompositeShape for MeshGraph

Source§

type PartShape = Triangle

Source§

type PartNormalConstraints = ()

Source§

fn map_typed_part_at<T>( &self, shape_id: u32, f: impl FnMut(Option<&Pose>, &Self::PartShape, Option<&Self::PartNormalConstraints>) -> T, ) -> Option<T>

Source§

fn map_untyped_part_at<T>( &self, shape_id: u32, f: impl FnMut(Option<&Pose>, &dyn Shape, Option<&dyn NormalConstraints>) -> T, ) -> Option<T>

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> 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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &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)

Converts &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> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
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