pub struct Material { /* private fields */ }
Expand description

A material represents a unique combination of a Texture and RenderPipeline, while also containing all nessicary buffers

Implementations§

source§

impl Material

source

pub fn change_texture(&mut self, texture: ResourceId<Texture>)

Examples found in repository?
examples/rectangles.rs (line 105)
100
101
102
103
104
105
106
107
    fn update(&mut self, engine_handle: &mut Engine) {
        let dt = engine_handle.get_frame_delta_time();
        self.pos.x += 100.0 * dt;
        if engine_handle.is_mouse_key_pressed(MouseKey::Left) {
            let new_texture = Texture::new(engine_handle, "examples/eggshark.png");
            self.texture_material.change_texture(new_texture);
        }
    }
source

pub fn add_rectangle( &mut self, position: Vec2<f32>, size: Vec2<f32>, colour: Colour, render: &RenderInformation<'_, '_> )

Will queue a Rectangle to be draw.

Examples found in repository?
examples/texture.rs (lines 45-50)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        self.current.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 400.0, y: 400.0 },
            Colour::WHITE,
            &render_handle,
        );
        self.current.draw(&mut render_handle);
    }
More examples
Hide additional examples
examples/debug_triangle.rs (lines 42-47)
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        self.material.add_triangle_with_coloured_verticies(
            [
                Vec2 { x: 200.0, y: 0.0 },
                Vec2 { x: 400.0, y: 400.0 },
                Vec2 { x: 0.0, y: 400.0 },
            ],
            [Colour::RED, Colour::GREEN, Colour::BLUE],
            &render_handle,
        );
        self.material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.material.draw(&mut render_handle);
    }
examples/shader.rs (lines 81-86)
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        self.mouse_material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.circle_material.add_rectangle(
            Vec2 { x: 100.0, y: 100.0 },
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.defualt_material.add_rectangle(
            Vec2 { x: 0.0, y: 200.0 },
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );

        self.mouse_material.draw(&mut render_handle);
        self.circle_material.draw(&mut render_handle);
        self.defualt_material.draw(&mut render_handle);
    }
examples/rectangles.rs (lines 46-51)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        let defualt_size = Vec2 { x: 50.0, y: 50.0 };
        self.regular_material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            defualt_size,
            Colour::RED,
            &render_handle,
        );
        self.regular_material.add_rectangle(
            self.pos,
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.texture_material.add_rectangle(
            Vec2 { x: 0.0, y: 50.0 },
            defualt_size,
            Colour::WHITE,
            &render_handle,
        );
        self.texture_material.add_rectangle_with_uv(
            Vec2 { x: 0.0, y: 100.0 },
            defualt_size,
            Vec2 { x: 311.0, y: 311.0 },
            Vec2 { x: 311.0, y: 311.0 },
            Colour::WHITE,
            &render_handle,
        );
        self.regular_material.add_rectangle_with_rotation(
            Vec2 { x: 0.0, y: 150.0 },
            defualt_size,
            Colour::GREEN,
            45.0,
            &render_handle,
        );

        let points = [
            Vec2 { x: 0.0, y: 300.0 },
            Vec2 { x: 80.0, y: 290.0 },
            Vec2 { x: 100.0, y: 400.0 },
            Vec2 { x: 60.0, y: 400.0 },
        ];
        let uvs = [
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 1.0, y: 0.0 },
            Vec2 { x: 1.0, y: 1.0 },
            Vec2 { x: 0.0, y: 1.0 },
        ];

        self.regular_material
            .add_custom(points, uvs, 0.0, Colour::RED, &render_handle);

        self.texture_material.draw(&mut render_handle);
        self.regular_material.draw(&mut render_handle);
    }
source

pub fn add_screenspace_rectangle( &mut self, position: Vec2<f32>, size: Vec2<f32>, colour: Colour, render: &RenderInformation<'_, '_> )

Queues a rectangle using WGSL cordinate space. (0, 0) is the center of the screen and (-1, 1) is the top left corner

source

pub fn add_rectangle_with_uv( &mut self, position: Vec2<f32>, size: Vec2<f32>, uv_position: Vec2<f32>, uv_size: Vec2<f32>, colour: Colour, render: &RenderInformation<'_, '_> )

Queues a rectagnle with UV coordniates. The position and size of the UV cordniates are the same as the pixels in the actaul image.

Examples found in repository?
examples/rectangles.rs (lines 64-71)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        let defualt_size = Vec2 { x: 50.0, y: 50.0 };
        self.regular_material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            defualt_size,
            Colour::RED,
            &render_handle,
        );
        self.regular_material.add_rectangle(
            self.pos,
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.texture_material.add_rectangle(
            Vec2 { x: 0.0, y: 50.0 },
            defualt_size,
            Colour::WHITE,
            &render_handle,
        );
        self.texture_material.add_rectangle_with_uv(
            Vec2 { x: 0.0, y: 100.0 },
            defualt_size,
            Vec2 { x: 311.0, y: 311.0 },
            Vec2 { x: 311.0, y: 311.0 },
            Colour::WHITE,
            &render_handle,
        );
        self.regular_material.add_rectangle_with_rotation(
            Vec2 { x: 0.0, y: 150.0 },
            defualt_size,
            Colour::GREEN,
            45.0,
            &render_handle,
        );

        let points = [
            Vec2 { x: 0.0, y: 300.0 },
            Vec2 { x: 80.0, y: 290.0 },
            Vec2 { x: 100.0, y: 400.0 },
            Vec2 { x: 60.0, y: 400.0 },
        ];
        let uvs = [
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 1.0, y: 0.0 },
            Vec2 { x: 1.0, y: 1.0 },
            Vec2 { x: 0.0, y: 1.0 },
        ];

        self.regular_material
            .add_custom(points, uvs, 0.0, Colour::RED, &render_handle);

        self.texture_material.draw(&mut render_handle);
        self.regular_material.draw(&mut render_handle);
    }
source

pub fn add_rectangle_with_rotation( &mut self, position: Vec2<f32>, size: Vec2<f32>, colour: Colour, rotation: f32, render: &RenderInformation<'_, '_> )

Queues a rectangle that will be rotated around its centerpoint. Rotation is in degrees

Examples found in repository?
examples/rectangles.rs (lines 72-78)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        let defualt_size = Vec2 { x: 50.0, y: 50.0 };
        self.regular_material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            defualt_size,
            Colour::RED,
            &render_handle,
        );
        self.regular_material.add_rectangle(
            self.pos,
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.texture_material.add_rectangle(
            Vec2 { x: 0.0, y: 50.0 },
            defualt_size,
            Colour::WHITE,
            &render_handle,
        );
        self.texture_material.add_rectangle_with_uv(
            Vec2 { x: 0.0, y: 100.0 },
            defualt_size,
            Vec2 { x: 311.0, y: 311.0 },
            Vec2 { x: 311.0, y: 311.0 },
            Colour::WHITE,
            &render_handle,
        );
        self.regular_material.add_rectangle_with_rotation(
            Vec2 { x: 0.0, y: 150.0 },
            defualt_size,
            Colour::GREEN,
            45.0,
            &render_handle,
        );

        let points = [
            Vec2 { x: 0.0, y: 300.0 },
            Vec2 { x: 80.0, y: 290.0 },
            Vec2 { x: 100.0, y: 400.0 },
            Vec2 { x: 60.0, y: 400.0 },
        ];
        let uvs = [
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 1.0, y: 0.0 },
            Vec2 { x: 1.0, y: 1.0 },
            Vec2 { x: 0.0, y: 1.0 },
        ];

        self.regular_material
            .add_custom(points, uvs, 0.0, Colour::RED, &render_handle);

        self.texture_material.draw(&mut render_handle);
        self.regular_material.draw(&mut render_handle);
    }
source

pub fn add_rectangle_ex( &mut self, position: Vec2<f32>, size: Vec2<f32>, colour: Colour, rotation: f32, uv_position: Vec2<f32>, uv_size: Vec2<f32>, render: &RenderInformation<'_, '_> )

Queues a rectangle with both UV, and Rotation,

source

pub fn add_screenspace_rectangle_ex( &mut self, position: Vec2<f32>, size: Vec2<f32>, colour: Colour, rotation: f32, uv_position: Vec2<f32>, uv_size: Vec2<f32>, render: &RenderInformation<'_, '_> )

Queues a rectangle with both UV, and Rotation, but will draw the rectangle in WGSL screenspace

source

pub fn add_custom( &mut self, points: [Vec2<f32>; 4], uv_points: [Vec2<f32>; 4], rotation: f32, colour: Colour, render: &RenderInformation<'_, '_> )

Queues a 4 pointed polygon with complete control over uv coordinates and rotation. The points need to be in top left, right bottom right and bottom left order as it will not render porperly otherwise.

Examples found in repository?
examples/rectangles.rs (line 94)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        let defualt_size = Vec2 { x: 50.0, y: 50.0 };
        self.regular_material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            defualt_size,
            Colour::RED,
            &render_handle,
        );
        self.regular_material.add_rectangle(
            self.pos,
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.texture_material.add_rectangle(
            Vec2 { x: 0.0, y: 50.0 },
            defualt_size,
            Colour::WHITE,
            &render_handle,
        );
        self.texture_material.add_rectangle_with_uv(
            Vec2 { x: 0.0, y: 100.0 },
            defualt_size,
            Vec2 { x: 311.0, y: 311.0 },
            Vec2 { x: 311.0, y: 311.0 },
            Colour::WHITE,
            &render_handle,
        );
        self.regular_material.add_rectangle_with_rotation(
            Vec2 { x: 0.0, y: 150.0 },
            defualt_size,
            Colour::GREEN,
            45.0,
            &render_handle,
        );

        let points = [
            Vec2 { x: 0.0, y: 300.0 },
            Vec2 { x: 80.0, y: 290.0 },
            Vec2 { x: 100.0, y: 400.0 },
            Vec2 { x: 60.0, y: 400.0 },
        ];
        let uvs = [
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 1.0, y: 0.0 },
            Vec2 { x: 1.0, y: 1.0 },
            Vec2 { x: 0.0, y: 1.0 },
        ];

        self.regular_material
            .add_custom(points, uvs, 0.0, Colour::RED, &render_handle);

        self.texture_material.draw(&mut render_handle);
        self.regular_material.draw(&mut render_handle);
    }
source

pub fn add_triangle( &mut self, p1: Vec2<f32>, p2: Vec2<f32>, p3: Vec2<f32>, colour: Colour, render: &RenderInformation<'_, '_> )

Queues a traingle, the points must be provided in clockwise order

source

pub fn add_triangle_with_coloured_verticies( &mut self, points: [Vec2<f32>; 3], colours: [Colour; 3], render: &RenderInformation<'_, '_> )

Queues a triangle where each vertex is given its own colour. Points must be given in clockwise order

Examples found in repository?
examples/debug_triangle.rs (lines 33-41)
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        self.material.add_triangle_with_coloured_verticies(
            [
                Vec2 { x: 200.0, y: 0.0 },
                Vec2 { x: 400.0, y: 400.0 },
                Vec2 { x: 0.0, y: 400.0 },
            ],
            [Colour::RED, Colour::GREEN, Colour::BLUE],
            &render_handle,
        );
        self.material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.material.draw(&mut render_handle);
    }
source

pub fn add_regular_n_gon( &mut self, number_of_sides: usize, radius: f32, center: Vec2<f32>, colour: Colour, render: &RenderInformation<'_, '_> )

Queues a polygon with the specified number of sides at a position with size and colour. This will not play nicely with texture as all the UV coords will be at [0, 0].

Examples found in repository?
examples/ngon.rs (lines 65-71)
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        self.regular_material.add_regular_n_gon(
            120,
            200.0,
            Vec2 { x: 250.0, y: 250.0 },
            Colour::BLUE,
            &render_handle,
        );

        self.regular_material.draw(&mut render_handle);
    }
source

pub fn update_uniform_data<T: ShaderType + WriteInto>( &mut self, data: &T, engine: &Engine )

Updates the uniform buffer to contain the same type but new data. You can write in a diffrent type from before but this could cause undefinded behavoir

Examples found in repository?
examples/ngon.rs (line 80)
76
77
78
79
80
81
    fn update(&mut self, engine_handle: &mut Engine) {
        let dt = engine_handle.get_frame_delta_time();
        self.time = (self.time + dt) % (32.0 * PI);
        self.regular_material
            .update_uniform_data(&self.time, &engine_handle);
    }
More examples
Hide additional examples
examples/shader.rs (line 122)
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
    fn update(&mut self, engine_handle: &mut Engine) {
        let dt = engine_handle.get_frame_delta_time();

        self.theta = (self.theta + dt) % (2.0 * PI);

        let size = engine_handle.get_window_size();
        let mouse_pos = engine_handle.get_mouse_position();

        let new_data = MousePos {
            x: mouse_pos.x / size.x as f32,
            y: mouse_pos.y / size.y as f32,
            _junk: 0.0,
            _padding2: 0.0,
        };

        self.data = new_data;
        self.mouse_material
            .update_uniform_data(&self.data, &engine_handle);
        self.circle_material
            .update_uniform_data(&self.theta, &engine_handle);
    }
source

pub fn get_vertex_number(&self) -> u64

Returns the number of verticies in the buffer

source

pub fn get_index_number(&self) -> u64

Returns the number if indincies in the buffer

source

pub fn get_texture_size(&self) -> Vec2<f32>

source

pub fn draw<'pass, 'others>( &'others mut self, information: &mut RenderInformation<'pass, 'others> )
where 'others: 'pass,

Draws all queued shapes to the screen.

Examples found in repository?
examples/texture.rs (line 51)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        self.current.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 400.0, y: 400.0 },
            Colour::WHITE,
            &render_handle,
        );
        self.current.draw(&mut render_handle);
    }
More examples
Hide additional examples
examples/ngon.rs (line 73)
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        self.regular_material.add_regular_n_gon(
            120,
            200.0,
            Vec2 { x: 250.0, y: 250.0 },
            Colour::BLUE,
            &render_handle,
        );

        self.regular_material.draw(&mut render_handle);
    }
examples/debug_triangle.rs (line 48)
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        self.material.add_triangle_with_coloured_verticies(
            [
                Vec2 { x: 200.0, y: 0.0 },
                Vec2 { x: 400.0, y: 400.0 },
                Vec2 { x: 0.0, y: 400.0 },
            ],
            [Colour::RED, Colour::GREEN, Colour::BLUE],
            &render_handle,
        );
        self.material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.material.draw(&mut render_handle);
    }
examples/shader.rs (line 100)
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        self.mouse_material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.circle_material.add_rectangle(
            Vec2 { x: 100.0, y: 100.0 },
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.defualt_material.add_rectangle(
            Vec2 { x: 0.0, y: 200.0 },
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );

        self.mouse_material.draw(&mut render_handle);
        self.circle_material.draw(&mut render_handle);
        self.defualt_material.draw(&mut render_handle);
    }
examples/rectangles.rs (line 96)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn render<'pass, 'others>(
        &'others mut self,
        mut render_handle: RenderInformation<'pass, 'others>,
    ) where
        'others: 'pass,
    {
        let defualt_size = Vec2 { x: 50.0, y: 50.0 };
        self.regular_material.add_rectangle(
            Vec2 { x: 0.0, y: 0.0 },
            defualt_size,
            Colour::RED,
            &render_handle,
        );
        self.regular_material.add_rectangle(
            self.pos,
            Vec2 { x: 100.0, y: 100.0 },
            Colour::RED,
            &render_handle,
        );
        self.texture_material.add_rectangle(
            Vec2 { x: 0.0, y: 50.0 },
            defualt_size,
            Colour::WHITE,
            &render_handle,
        );
        self.texture_material.add_rectangle_with_uv(
            Vec2 { x: 0.0, y: 100.0 },
            defualt_size,
            Vec2 { x: 311.0, y: 311.0 },
            Vec2 { x: 311.0, y: 311.0 },
            Colour::WHITE,
            &render_handle,
        );
        self.regular_material.add_rectangle_with_rotation(
            Vec2 { x: 0.0, y: 150.0 },
            defualt_size,
            Colour::GREEN,
            45.0,
            &render_handle,
        );

        let points = [
            Vec2 { x: 0.0, y: 300.0 },
            Vec2 { x: 80.0, y: 290.0 },
            Vec2 { x: 100.0, y: 400.0 },
            Vec2 { x: 60.0, y: 400.0 },
        ];
        let uvs = [
            Vec2 { x: 0.0, y: 0.0 },
            Vec2 { x: 1.0, y: 0.0 },
            Vec2 { x: 1.0, y: 1.0 },
            Vec2 { x: 0.0, y: 1.0 },
        ];

        self.regular_material
            .add_custom(points, uvs, 0.0, Colour::RED, &render_handle);

        self.texture_material.draw(&mut render_handle);
        self.regular_material.draw(&mut render_handle);
    }

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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSync for T
where T: Sync,