pub struct MeshData<P: Part = NoParts, C: Clip = NoClips> { /* private fields */ }Expand description
A mesh’s vertices and indices, in the slots the parts P select, posed
by the clips C name.
The indices define counter-clockwise triangles; the draw’s transform places and scales the mesh.
Implementations§
Source§impl MeshData
impl MeshData
Sourcepub fn new(vertices: Vec<Vertex>, indices: Vec<u32>) -> Self
pub fn new(vertices: Vec<Vertex>, indices: Vec<u32>) -> Self
A mesh of one slot, drawn with Material::default.
Every index must point to a vertex; one past them is an error the catalog run reports. Every triangle’s three indices run counter-clockwise seen from outside the mesh: a triangle seen from behind is not drawn.
Examples found in repository?
164fn ring_outline() -> MeshData {
165 const SEGMENTS: u32 = 48;
166 const OUTER: f32 = 1.0;
167 const INNER: f32 = 0.94;
168
169 let mut vertices = Vec::with_capacity(SEGMENTS as usize * 4);
170 let mut indices = Vec::with_capacity(SEGMENTS as usize * 6);
171 for segment in 0..SEGMENTS {
172 let a0 = segment as f32 / SEGMENTS as f32 * TAU;
173 let a1 = (segment + 1) as f32 / SEGMENTS as f32 * TAU;
174 let (u0, v0) = (a0.cos(), a0.sin());
175 let (u1, v1) = (a1.cos(), a1.sin());
176 let base = vertices.len() as u32;
177 vertices.extend([
178 Vertex::new(Vec3::new(INNER * u0, 0.0, -INNER * v0), Vec3::Y, Vec2::ZERO),
179 Vertex::new(Vec3::new(OUTER * u0, 0.0, -OUTER * v0), Vec3::Y, Vec2::ZERO),
180 Vertex::new(Vec3::new(OUTER * u1, 0.0, -OUTER * v1), Vec3::Y, Vec2::ZERO),
181 Vertex::new(Vec3::new(INNER * u1, 0.0, -INNER * v1), Vec3::Y, Vec2::ZERO),
182 ]);
183 indices.extend([base, base + 1, base + 2, base, base + 2, base + 3]);
184 }
185 MeshData::new(vertices, indices)
186}
187
188fn facing_marker() -> MeshData {
189 const TIP: Vec3 = Vec3::new(0.0, 0.0, -0.5);
190 const BACK: [Vec3; 4] = [
191 Vec3::new(-0.5, -0.5, 0.5),
192 Vec3::new(0.5, -0.5, 0.5),
193 Vec3::new(0.5, 0.5, 0.5),
194 Vec3::new(-0.5, 0.5, 0.5),
195 ];
196
197 let mut vertices = Vec::with_capacity(BACK.len() * 3);
198 for (corner, next) in BACK.iter().zip(BACK.iter().cycle().skip(1)) {
199 let normal = (next - corner).cross(TIP - corner).normalize();
200 vertices.extend([
201 Vertex::new(*corner, normal, Vec2::new(0.0, 1.0)),
202 Vertex::new(*next, normal, Vec2::new(1.0, 1.0)),
203 Vertex::new(TIP, normal, Vec2::new(0.5, 0.0)),
204 ]);
205 }
206 let indices = (0..vertices.len() as u32).collect();
207 MeshData::new(vertices, indices)
208}More examples
525fn build_rock(seed: u32) -> MeshData {
526 let height = ROCK_HEIGHT * (1.0 + hash_signed(seed, ROCK_SIDES) * ROCK_HEIGHT_DISPLACEMENT);
527 let apex = Vec3::Y * height;
528 let base: Vec<Vec3> = (0..ROCK_SIDES)
529 .map(|corner| {
530 let angle = core::f32::consts::TAU * corner as f32 / ROCK_SIDES as f32;
531 let radius =
532 ROCK_BASE_RADIUS * (1.0 + hash_signed(seed, corner) * ROCK_RADIAL_DISPLACEMENT);
533 Vec3::new(angle.cos() * radius, 0.0, angle.sin() * radius)
534 })
535 .collect();
536
537 let mut vertices = Vec::with_capacity(base.len() * 6);
538 let mut indices = Vec::with_capacity(base.len() * 6);
539 for corner in 0..base.len() {
540 let next = (corner + 1) % base.len();
541 push_face(&mut vertices, &mut indices, base[corner], apex, base[next]);
542 push_face(
543 &mut vertices,
544 &mut indices,
545 base[corner],
546 base[next],
547 Vec3::ZERO,
548 );
549 }
550
551 MeshData::new(vertices, indices).with_material(Material::lit(ROCK_COLOR))
552}360fn banner_mesh() -> MeshData {
361 let mut vertices = Vec::with_capacity(((BANNER_COLUMNS + 1) * 4) as usize);
362 for normal in [Vec3::Z, Vec3::NEG_Z] {
363 for column in 0..=BANNER_COLUMNS {
364 let u = column as f32 / BANNER_COLUMNS as f32;
365 let x = u * BANNER_WIDTH;
366 for v in [0.0, 1.0] {
367 vertices.push(Vertex::new(
368 Vec3::new(x, -v * BANNER_HEIGHT, 0.0),
369 normal,
370 Vec2::new(u, v),
371 ));
372 }
373 }
374 }
375
376 let side = BANNER_COLUMNS + 1;
377 let mut indices = Vec::with_capacity((BANNER_COLUMNS * 12) as usize);
378 for column in 0..BANNER_COLUMNS {
379 let top_left = column * 2;
380 let bottom_left = top_left + 1;
381 let top_right = top_left + 2;
382 let bottom_right = top_left + 3;
383 indices.extend([
384 bottom_left,
385 bottom_right,
386 top_right,
387 bottom_left,
388 top_right,
389 top_left,
390 ]);
391
392 let back = side * 2;
393 indices.extend([
394 back + top_right,
395 back + bottom_right,
396 back + bottom_left,
397 back + top_left,
398 back + top_right,
399 back + bottom_left,
400 ]);
401 }
402
403 MeshData::new(vertices, indices)
404}724fn build_rock(seed: u32) -> MeshData {
725 let corners: [Vec3; 8] = core::array::from_fn(|index| {
726 let sign = Vec3::new(
727 if index & 1 == 0 { -0.5 } else { 0.5 },
728 if index & 2 == 0 { -0.5 } else { 0.5 },
729 if index & 4 == 0 { -0.5 } else { 0.5 },
730 );
731 sign + corner_offset(seed, index as u32)
732 });
733 let corner_at = |sign: Vec3| corners[corner_index(sign)];
734
735 let mut vertices = Vec::with_capacity(ROCK_FACES.len() * 4);
736 let mut indices = Vec::with_capacity(ROCK_FACES.len() * 6);
737 for (face, &(normal, right, up)) in ROCK_FACES.iter().enumerate() {
738 let quad = [
739 corner_at(normal - right - up),
740 corner_at(normal + right - up),
741 corner_at(normal + right + up),
742 corner_at(normal - right + up),
743 ];
744 let normal = (quad[1] - quad[0]).cross(quad[3] - quad[0]).normalize();
745 let uvs = [
746 Vec2::new(0.0, 1.0),
747 Vec2::new(1.0, 1.0),
748 Vec2::new(1.0, 0.0),
749 Vec2::new(0.0, 0.0),
750 ];
751 vertices.extend(
752 quad.into_iter()
753 .zip(uvs)
754 .map(|(corner, uv)| Vertex::new(corner, normal, uv)),
755 );
756 let base = face as u32 * 4;
757 indices.extend(ROCK_TRIANGLES.map(|index| base + index));
758 }
759 MeshData::new(vertices, indices)
760}Source§impl<P: Part, C: Clip> MeshData<P, C>
impl<P: Part, C: Clip> MeshData<P, C>
Sourcepub fn with_material(self, material: Material) -> Self
pub fn with_material(self, material: Material) -> Self
Sets the material of every slot.
Examples found in repository?
More examples
582 fn build(&self, assets: &Assets) -> MeshData {
583 Plane
584 .build(assets)
585 .with_texture(assets.texture(POND_SHEET).pixelated())
586 .with_material(Material::lit(Color::WHITE).cutout())
587 }
588}
589
590/// A crate prop, its texture drawn over a cube.
591#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
592struct Crate;
593
594impl Mesh for Crate {
595 fn build(&self, assets: &Assets) -> MeshData {
596 Cube.build(assets)
597 .with_texture(assets.texture(CRATE_TEXTURE).pixelated())
598 }
599}
600
601/// The well's rim.
602#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
603struct Well;
604
605impl Mesh for Well {
606 fn build(&self, assets: &Assets) -> MeshData {
607 Cube.build(assets)
608 .with_texture(assets.texture(WELL_SHEET).pixelated())
609 }
610}
611
612/// The well's mouth, laid flat over the rim's top face.
613#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
614struct WellMouth;
615
616impl Mesh for WellMouth {
617 fn build(&self, assets: &Assets) -> MeshData {
618 Plane
619 .build(assets)
620 .with_texture(assets.texture(WELL_SHEET).pixelated())
621 }
622}
623
624/// A stone box: the mouth's pillars and lintel.
625#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
626struct Stone;
627
628impl Mesh for Stone {
629 fn build(&self, assets: &Assets) -> MeshData {
630 Cube.build(assets)
631 .with_texture(assets.texture(STONE_SHEET).pixelated())
632 }
633}
634
635/// A bush sprite, cutout with its own relief.
636#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
637struct Bush;
638
639impl Mesh for Bush {
640 fn build(&self, assets: &Assets) -> MeshData {
641 Quad.build(assets)
642 .with_texture(assets.texture(BUSH_SPRITE).pixelated())
643 .with_relief(assets.relief(BUSH_RELIEF))
644 .with_material(Material::lit(Color::WHITE).cutout())
645 }
646}
647
648/// A rock sprite, cutout with its own relief.
649#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
650struct Rock;
651
652impl Mesh for Rock {
653 fn build(&self, assets: &Assets) -> MeshData {
654 Quad.build(assets)
655 .with_texture(assets.texture(ROCK_SPRITE).pixelated())
656 .with_relief(assets.relief(ROCK_RELIEF))
657 .with_material(Material::lit(Color::WHITE).cutout())
658 }
659}
660
661/// A torch's post sprite, cutout with its own relief.
662#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
663struct Torch;
664
665impl Mesh for Torch {
666 fn build(&self, assets: &Assets) -> MeshData {
667 Quad.build(assets)
668 .with_texture(assets.texture(TORCH_SPRITE).pixelated())
669 .with_relief(assets.relief(TORCH_RELIEF))
670 .with_material(Material::lit(Color::WHITE).cutout())
671 }
672}
673
674/// A torch's flame sprite, added over the dark rather than lit.
675#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
676struct Flame;
677
678impl Mesh for Flame {
679 fn build(&self, assets: &Assets) -> MeshData {
680 Quad.build(assets)
681 .with_texture(assets.texture(FLAME_SHEET).pixelated())
682 .with_material(Material::color(FLAME_TINT).additive())
683 }
684}
685
686/// The player's sprite, cutout with its own relief, its sheet shared
687/// with `examples/isometric-board.rs`.
688#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
689struct Walker;
690
691impl Mesh for Walker {
692 fn build(&self, assets: &Assets) -> MeshData {
693 Quad.build(assets)
694 .with_texture(assets.texture(WALKER_SHEET).pixelated())
695 .with_relief(assets.relief(WALKER_RELIEF))
696 .with_material(Material::lit(Color::WHITE).cutout())
697 }525fn build_rock(seed: u32) -> MeshData {
526 let height = ROCK_HEIGHT * (1.0 + hash_signed(seed, ROCK_SIDES) * ROCK_HEIGHT_DISPLACEMENT);
527 let apex = Vec3::Y * height;
528 let base: Vec<Vec3> = (0..ROCK_SIDES)
529 .map(|corner| {
530 let angle = core::f32::consts::TAU * corner as f32 / ROCK_SIDES as f32;
531 let radius =
532 ROCK_BASE_RADIUS * (1.0 + hash_signed(seed, corner) * ROCK_RADIAL_DISPLACEMENT);
533 Vec3::new(angle.cos() * radius, 0.0, angle.sin() * radius)
534 })
535 .collect();
536
537 let mut vertices = Vec::with_capacity(base.len() * 6);
538 let mut indices = Vec::with_capacity(base.len() * 6);
539 for corner in 0..base.len() {
540 let next = (corner + 1) % base.len();
541 push_face(&mut vertices, &mut indices, base[corner], apex, base[next]);
542 push_face(
543 &mut vertices,
544 &mut indices,
545 base[corner],
546 base[next],
547 Vec3::ZERO,
548 );
549 }
550
551 MeshData::new(vertices, indices).with_material(Material::lit(ROCK_COLOR))
552}Sourcepub fn with_texture(self, texture: TextureData) -> Self
pub fn with_texture(self, texture: TextureData) -> Self
Samples every slot from texture, in place of a white default.
Examples found in repository?
More examples
569 fn build(&self, assets: &Assets) -> MeshData {
570 Plane
571 .build(assets)
572 .with_texture(assets.texture(GROUND_SHEET).pixelated())
573 }
574}
575
576/// The shoreline sprite laid over the pond's styled water, cutout so the
577/// water shows through its cleared middle.
578#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
579struct Shore;
580
581impl Mesh for Shore {
582 fn build(&self, assets: &Assets) -> MeshData {
583 Plane
584 .build(assets)
585 .with_texture(assets.texture(POND_SHEET).pixelated())
586 .with_material(Material::lit(Color::WHITE).cutout())
587 }
588}
589
590/// A crate prop, its texture drawn over a cube.
591#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
592struct Crate;
593
594impl Mesh for Crate {
595 fn build(&self, assets: &Assets) -> MeshData {
596 Cube.build(assets)
597 .with_texture(assets.texture(CRATE_TEXTURE).pixelated())
598 }
599}
600
601/// The well's rim.
602#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
603struct Well;
604
605impl Mesh for Well {
606 fn build(&self, assets: &Assets) -> MeshData {
607 Cube.build(assets)
608 .with_texture(assets.texture(WELL_SHEET).pixelated())
609 }
610}
611
612/// The well's mouth, laid flat over the rim's top face.
613#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
614struct WellMouth;
615
616impl Mesh for WellMouth {
617 fn build(&self, assets: &Assets) -> MeshData {
618 Plane
619 .build(assets)
620 .with_texture(assets.texture(WELL_SHEET).pixelated())
621 }
622}
623
624/// A stone box: the mouth's pillars and lintel.
625#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
626struct Stone;
627
628impl Mesh for Stone {
629 fn build(&self, assets: &Assets) -> MeshData {
630 Cube.build(assets)
631 .with_texture(assets.texture(STONE_SHEET).pixelated())
632 }
633}
634
635/// A bush sprite, cutout with its own relief.
636#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
637struct Bush;
638
639impl Mesh for Bush {
640 fn build(&self, assets: &Assets) -> MeshData {
641 Quad.build(assets)
642 .with_texture(assets.texture(BUSH_SPRITE).pixelated())
643 .with_relief(assets.relief(BUSH_RELIEF))
644 .with_material(Material::lit(Color::WHITE).cutout())
645 }
646}
647
648/// A rock sprite, cutout with its own relief.
649#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
650struct Rock;
651
652impl Mesh for Rock {
653 fn build(&self, assets: &Assets) -> MeshData {
654 Quad.build(assets)
655 .with_texture(assets.texture(ROCK_SPRITE).pixelated())
656 .with_relief(assets.relief(ROCK_RELIEF))
657 .with_material(Material::lit(Color::WHITE).cutout())
658 }
659}
660
661/// A torch's post sprite, cutout with its own relief.
662#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
663struct Torch;
664
665impl Mesh for Torch {
666 fn build(&self, assets: &Assets) -> MeshData {
667 Quad.build(assets)
668 .with_texture(assets.texture(TORCH_SPRITE).pixelated())
669 .with_relief(assets.relief(TORCH_RELIEF))
670 .with_material(Material::lit(Color::WHITE).cutout())
671 }
672}
673
674/// A torch's flame sprite, added over the dark rather than lit.
675#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
676struct Flame;
677
678impl Mesh for Flame {
679 fn build(&self, assets: &Assets) -> MeshData {
680 Quad.build(assets)
681 .with_texture(assets.texture(FLAME_SHEET).pixelated())
682 .with_material(Material::color(FLAME_TINT).additive())
683 }
684}
685
686/// The player's sprite, cutout with its own relief, its sheet shared
687/// with `examples/isometric-board.rs`.
688#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
689struct Walker;
690
691impl Mesh for Walker {
692 fn build(&self, assets: &Assets) -> MeshData {
693 Quad.build(assets)
694 .with_texture(assets.texture(WALKER_SHEET).pixelated())
695 .with_relief(assets.relief(WALKER_RELIEF))
696 .with_material(Material::lit(Color::WHITE).cutout())
697 }
698}
699
700/// The cave floor tile.
701#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
702struct CaveFloor;
703
704impl Mesh for CaveFloor {
705 fn build(&self, assets: &Assets) -> MeshData {
706 Plane
707 .build(assets)
708 .with_texture(assets.texture(CAVE_SHEET).pixelated())
709 }
710}
711
712/// The cave wall face.
713#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
714struct CaveWall;
715
716impl Mesh for CaveWall {
717 fn build(&self, assets: &Assets) -> MeshData {
718 Cube.build(assets)
719 .with_texture(assets.texture(CAVE_SHEET).pixelated())
720 }Sourcepub fn with_relief(self, relief: ReliefData) -> Self
pub fn with_relief(self, relief: ReliefData) -> Self
Reads the relief of every slot from relief.
See Slot::relief for what the channels hold and which draws read
them.
Examples found in repository?
More examples
640 fn build(&self, assets: &Assets) -> MeshData {
641 Quad.build(assets)
642 .with_texture(assets.texture(BUSH_SPRITE).pixelated())
643 .with_relief(assets.relief(BUSH_RELIEF))
644 .with_material(Material::lit(Color::WHITE).cutout())
645 }
646}
647
648/// A rock sprite, cutout with its own relief.
649#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
650struct Rock;
651
652impl Mesh for Rock {
653 fn build(&self, assets: &Assets) -> MeshData {
654 Quad.build(assets)
655 .with_texture(assets.texture(ROCK_SPRITE).pixelated())
656 .with_relief(assets.relief(ROCK_RELIEF))
657 .with_material(Material::lit(Color::WHITE).cutout())
658 }
659}
660
661/// A torch's post sprite, cutout with its own relief.
662#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
663struct Torch;
664
665impl Mesh for Torch {
666 fn build(&self, assets: &Assets) -> MeshData {
667 Quad.build(assets)
668 .with_texture(assets.texture(TORCH_SPRITE).pixelated())
669 .with_relief(assets.relief(TORCH_RELIEF))
670 .with_material(Material::lit(Color::WHITE).cutout())
671 }
672}
673
674/// A torch's flame sprite, added over the dark rather than lit.
675#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
676struct Flame;
677
678impl Mesh for Flame {
679 fn build(&self, assets: &Assets) -> MeshData {
680 Quad.build(assets)
681 .with_texture(assets.texture(FLAME_SHEET).pixelated())
682 .with_material(Material::color(FLAME_TINT).additive())
683 }
684}
685
686/// The player's sprite, cutout with its own relief, its sheet shared
687/// with `examples/isometric-board.rs`.
688#[derive(Catalog, Clone, PartialEq, Eq, Hash)]
689struct Walker;
690
691impl Mesh for Walker {
692 fn build(&self, assets: &Assets) -> MeshData {
693 Quad.build(assets)
694 .with_texture(assets.texture(WALKER_SHEET).pixelated())
695 .with_relief(assets.relief(WALKER_RELIEF))
696 .with_material(Material::lit(Color::WHITE).cutout())
697 }Sourcepub fn with_shading(self, shading: ShadingData) -> Self
pub fn with_shading(self, shading: ShadingData) -> Self
Reads the shading of every slot from shading.
See Slot::shading for what the channels hold and what each one
scales.
Sourcepub fn with_emissive_map(self, emissive: TextureData) -> Self
pub fn with_emissive_map(self, emissive: TextureData) -> Self
Reads the light every slot casts per texel from emissive.
See Slot::emissive_map for what scales it.
Source§impl<P: Part> MeshData<P, NoClips>
impl<P: Part> MeshData<P, NoClips>
Sourcepub fn in_parts(
vertices: Vec<Vertex>,
indices: Vec<u32>,
slot: impl FnMut(P) -> Slot,
) -> Self
pub fn in_parts( vertices: Vec<Vertex>, indices: Vec<u32>, slot: impl FnMut(P) -> Slot, ) -> Self
A mesh of one slot per part, in the order the parts count themselves, each slot taking the next indices.
Required if you want a generated mesh with parts a draw repaints one
at a time. slot runs once per part, so every part has a slot. The
slot lengths must cover the indices exactly; otherwise that is an
error the catalog run reports. Every triangle’s three indices run
counter-clockwise seen from outside the mesh: a triangle seen from
behind is not drawn.
Trait Implementations§
Auto Trait Implementations§
impl<P, C> Freeze for MeshData<P, C>
impl<P, C> RefUnwindSafe for MeshData<P, C>
impl<P, C> Send for MeshData<P, C>
impl<P, C> Sync for MeshData<P, C>
impl<P, C> Unpin for MeshData<P, C>
impl<P, C> UnsafeUnpin for MeshData<P, C>
impl<P, C> UnwindSafe for MeshData<P, C>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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 more