Skip to main content

TextBodyProperties

Struct TextBodyProperties 

Source
pub struct TextBodyProperties {
    pub wrap: Option<TextWrap>,
    pub anchor: Option<TextAnchor>,
    pub anchor_center: bool,
    pub inset_left_emu: Option<i64>,
    pub inset_top_emu: Option<i64>,
    pub inset_right_emu: Option<i64>,
    pub inset_bottom_emu: Option<i64>,
    pub autofit: Option<TextAutofit>,
    pub vertical_direction: Option<TextVerticalType>,
    pub rotation_60000ths: i32,
}
Expand description

<a:bodyPr>’s attributes (CT_TextBodyProperties) — text wrapping, vertical anchor, horizontal centering, inset margins, and autofit. See TextBody’s doc comment for what else CT_TextBodyProperties allows but isn’t modeled here (3D, preset text warp/WordArt).

Fields§

§wrap: Option<TextWrap>

wrap — whether text wraps at the shape’s edge.

§anchor: Option<TextAnchor>

anchor — vertical alignment of the text block within the shape.

§anchor_center: bool

anchorCtr — additionally centers the text block horizontally within the shape (on top of whatever anchor does vertically). Grounded against a real fixture.

§inset_left_emu: Option<i64>

lIns, in EMUs.

§inset_top_emu: Option<i64>

tIns, in EMUs.

§inset_right_emu: Option<i64>

rIns, in EMUs.

§inset_bottom_emu: Option<i64>

bIns, in EMUs.

§autofit: Option<TextAutofit>

EG_TextAutofit (<a:noAutofit/>/<a:normAutofit/>/ <a:spAutoFit/>) — how the text body reacts to content that doesn’t fit its shape. None omits the choice entirely (Office’s own implicit default, which real PowerPoint UI actually treats as equivalent to TextAutofit::None).

§vertical_direction: Option<TextVerticalType>

vert (ST_TextVerticalType) — the text’s reading direction within its shape (horizontal, stacked vertically, rotated 270°.). None omits the attribute ("horz", ordinary left-to-right text, is the schema default). Grounded against a real fixture’s placeholder (vert="eaVert").

§rotation_60000ths: i32

rot (ST_Angle, 60,000ths of a degree) — rotates the text within its shape, independent of the shape’s own rotation (Transform2D::rotation_degrees, on the surrounding <a:xfrm>). 0 (the default) omits the attribute. Grounded against a real fixture’s <a:bodyPr rot="0".>.

Implementations§

Source§

impl TextBodyProperties

Source

pub fn new() -> TextBodyProperties

Examples found in repository?
examples/pptx_text_formatting.rs (line 88)
19fn main() -> office_toolkit::Result<()> {
20    let path = output_path("pptx_text_formatting.pptx");
21
22    let spacing_shape = AutoShape::new(2, "Spacing")
23        .with_properties(
24            ShapeProperties::new().with_transform(
25                Transform2D::new()
26                    .with_offset(838_200, 838_200)
27                    .with_extent(6_000_000, 1_500_000),
28            ),
29        )
30        .with_text_body(
31            TextBody::new().with_paragraph(
32                TextParagraph::new()
33                    .with_properties(
34                        TextParagraphProperties::new()
35                            .with_line_spacing(TextSpacing::Percent(150_000))
36                            .with_space_before(TextSpacing::Points(1200))
37                            .with_indent_emu(457_200)
38                            .with_level(1),
39                    )
40                    .with_run(TextRun::text(
41                        "Indented, 150% line spacing, 12pt space before.",
42                    )),
43            ),
44        );
45
46    let bullets_shape = AutoShape::new(2, "Bullets")
47        .with_properties(
48            ShapeProperties::new().with_transform(
49                Transform2D::new()
50                    .with_offset(838_200, 838_200)
51                    .with_extent(6_000_000, 1_800_000),
52            ),
53        )
54        .with_text_body(
55            TextBody::new()
56                .with_paragraph(
57                    TextParagraph::new()
58                        .with_properties(
59                            TextParagraphProperties::new()
60                                .with_bullet(BulletKind::Character("\u{2022}".to_string())),
61                        )
62                        .with_run(TextRun::text("Bulleted item")),
63                )
64                .with_paragraph(
65                    TextParagraph::new()
66                        .with_properties(TextParagraphProperties::new().with_bullet(
67                            BulletKind::AutoNumber {
68                                scheme: "arabicPeriod".to_string(),
69                                start_at: None,
70                            },
71                        ))
72                        .with_run(TextRun::text("Auto-numbered item")),
73                ),
74        );
75
76    let autofit_shape = AutoShape::new(2, "Autofit")
77        .with_text_box(true)
78        .with_properties(
79            ShapeProperties::new().with_transform(
80                Transform2D::new()
81                    .with_offset(838_200, 838_200)
82                    .with_extent(4_000_000, 1_000_000),
83            ),
84        )
85        .with_text_body(
86            TextBody::new()
87                .with_properties(
88                    TextBodyProperties::new()
89                        .with_autofit(TextAutofit::Shape)
90                        .with_anchor(TextAnchor::Center)
91                        .with_anchor_center(true),
92                )
93                .with_paragraph(TextParagraph::new().with_run(TextRun::text(
94                    "This shape resizes to fit its text, centered both ways.",
95                ))),
96        );
97
98    let casing_shape = AutoShape::new(2, "Casing")
99        .with_properties(
100            ShapeProperties::new().with_transform(
101                Transform2D::new()
102                    .with_offset(838_200, 838_200)
103                    .with_extent(6_000_000, 1_500_000),
104            ),
105        )
106        .with_text_body(
107            TextBody::new().with_paragraph(
108                TextParagraph::new()
109                    .with_run(TextRun::text_with_properties(
110                        "rendered in all caps, ",
111                        TextRunProperties::new().with_text_caps(TextCaps::All),
112                    ))
113                    .with_run(TextRun::text_with_properties(
114                        "widely spaced, ",
115                        TextRunProperties::new().with_character_spacing_points(3.0),
116                    ))
117                    .with_run(TextRun::text_with_properties(
118                        "highlighted",
119                        TextRunProperties::new().with_highlight(Color::Rgb("FFFF00".to_string())),
120                    ))
121                    .with_run(TextRun::text_with_properties(
122                        "2",
123                        TextRunProperties::new().with_baseline_percent(30.0),
124                    )),
125            ),
126        );
127
128    let field_shape = AutoShape::new(2, "Field")
129        .with_properties(
130            ShapeProperties::new().with_transform(
131                Transform2D::new()
132                    .with_offset(838_200, 838_200)
133                    .with_extent(3_000_000, 500_000),
134            ),
135        )
136        .with_text_body(
137            TextBody::new().with_paragraph(
138                TextParagraph::new()
139                    .with_run(TextRun::text("Slide "))
140                    .with_run(TextRun::field(
141                        "{7A9E3F10-4B6C-4D2E-9A1F-8C5D6E7F0123}",
142                        Some("slidenum".to_string()),
143                        "1",
144                    )),
145            ),
146        );
147
148    let presentation = Presentation::new()
149        .with_slide(Slide::new().with_shape(Shape::AutoShape(spacing_shape)))
150        .with_slide(Slide::new().with_shape(Shape::AutoShape(bullets_shape)))
151        .with_slide(Slide::new().with_shape(Shape::AutoShape(autofit_shape)))
152        .with_slide(Slide::new().with_shape(Shape::AutoShape(casing_shape)))
153        .with_slide(Slide::new().with_shape(Shape::AutoShape(field_shape)));
154
155    presentation.save_to_file(&path)?;
156    println!("Wrote {}", path.display());
157    Ok(())
158}
Source

pub fn with_wrap(self, wrap: TextWrap) -> TextBodyProperties

Source

pub fn with_anchor(self, anchor: TextAnchor) -> TextBodyProperties

Examples found in repository?
examples/pptx_text_formatting.rs (line 90)
19fn main() -> office_toolkit::Result<()> {
20    let path = output_path("pptx_text_formatting.pptx");
21
22    let spacing_shape = AutoShape::new(2, "Spacing")
23        .with_properties(
24            ShapeProperties::new().with_transform(
25                Transform2D::new()
26                    .with_offset(838_200, 838_200)
27                    .with_extent(6_000_000, 1_500_000),
28            ),
29        )
30        .with_text_body(
31            TextBody::new().with_paragraph(
32                TextParagraph::new()
33                    .with_properties(
34                        TextParagraphProperties::new()
35                            .with_line_spacing(TextSpacing::Percent(150_000))
36                            .with_space_before(TextSpacing::Points(1200))
37                            .with_indent_emu(457_200)
38                            .with_level(1),
39                    )
40                    .with_run(TextRun::text(
41                        "Indented, 150% line spacing, 12pt space before.",
42                    )),
43            ),
44        );
45
46    let bullets_shape = AutoShape::new(2, "Bullets")
47        .with_properties(
48            ShapeProperties::new().with_transform(
49                Transform2D::new()
50                    .with_offset(838_200, 838_200)
51                    .with_extent(6_000_000, 1_800_000),
52            ),
53        )
54        .with_text_body(
55            TextBody::new()
56                .with_paragraph(
57                    TextParagraph::new()
58                        .with_properties(
59                            TextParagraphProperties::new()
60                                .with_bullet(BulletKind::Character("\u{2022}".to_string())),
61                        )
62                        .with_run(TextRun::text("Bulleted item")),
63                )
64                .with_paragraph(
65                    TextParagraph::new()
66                        .with_properties(TextParagraphProperties::new().with_bullet(
67                            BulletKind::AutoNumber {
68                                scheme: "arabicPeriod".to_string(),
69                                start_at: None,
70                            },
71                        ))
72                        .with_run(TextRun::text("Auto-numbered item")),
73                ),
74        );
75
76    let autofit_shape = AutoShape::new(2, "Autofit")
77        .with_text_box(true)
78        .with_properties(
79            ShapeProperties::new().with_transform(
80                Transform2D::new()
81                    .with_offset(838_200, 838_200)
82                    .with_extent(4_000_000, 1_000_000),
83            ),
84        )
85        .with_text_body(
86            TextBody::new()
87                .with_properties(
88                    TextBodyProperties::new()
89                        .with_autofit(TextAutofit::Shape)
90                        .with_anchor(TextAnchor::Center)
91                        .with_anchor_center(true),
92                )
93                .with_paragraph(TextParagraph::new().with_run(TextRun::text(
94                    "This shape resizes to fit its text, centered both ways.",
95                ))),
96        );
97
98    let casing_shape = AutoShape::new(2, "Casing")
99        .with_properties(
100            ShapeProperties::new().with_transform(
101                Transform2D::new()
102                    .with_offset(838_200, 838_200)
103                    .with_extent(6_000_000, 1_500_000),
104            ),
105        )
106        .with_text_body(
107            TextBody::new().with_paragraph(
108                TextParagraph::new()
109                    .with_run(TextRun::text_with_properties(
110                        "rendered in all caps, ",
111                        TextRunProperties::new().with_text_caps(TextCaps::All),
112                    ))
113                    .with_run(TextRun::text_with_properties(
114                        "widely spaced, ",
115                        TextRunProperties::new().with_character_spacing_points(3.0),
116                    ))
117                    .with_run(TextRun::text_with_properties(
118                        "highlighted",
119                        TextRunProperties::new().with_highlight(Color::Rgb("FFFF00".to_string())),
120                    ))
121                    .with_run(TextRun::text_with_properties(
122                        "2",
123                        TextRunProperties::new().with_baseline_percent(30.0),
124                    )),
125            ),
126        );
127
128    let field_shape = AutoShape::new(2, "Field")
129        .with_properties(
130            ShapeProperties::new().with_transform(
131                Transform2D::new()
132                    .with_offset(838_200, 838_200)
133                    .with_extent(3_000_000, 500_000),
134            ),
135        )
136        .with_text_body(
137            TextBody::new().with_paragraph(
138                TextParagraph::new()
139                    .with_run(TextRun::text("Slide "))
140                    .with_run(TextRun::field(
141                        "{7A9E3F10-4B6C-4D2E-9A1F-8C5D6E7F0123}",
142                        Some("slidenum".to_string()),
143                        "1",
144                    )),
145            ),
146        );
147
148    let presentation = Presentation::new()
149        .with_slide(Slide::new().with_shape(Shape::AutoShape(spacing_shape)))
150        .with_slide(Slide::new().with_shape(Shape::AutoShape(bullets_shape)))
151        .with_slide(Slide::new().with_shape(Shape::AutoShape(autofit_shape)))
152        .with_slide(Slide::new().with_shape(Shape::AutoShape(casing_shape)))
153        .with_slide(Slide::new().with_shape(Shape::AutoShape(field_shape)));
154
155    presentation.save_to_file(&path)?;
156    println!("Wrote {}", path.display());
157    Ok(())
158}
Source

pub fn with_anchor_center(self, anchor_center: bool) -> TextBodyProperties

Additionally centers the text block horizontally (anchorCtr="1").

Examples found in repository?
examples/pptx_text_formatting.rs (line 91)
19fn main() -> office_toolkit::Result<()> {
20    let path = output_path("pptx_text_formatting.pptx");
21
22    let spacing_shape = AutoShape::new(2, "Spacing")
23        .with_properties(
24            ShapeProperties::new().with_transform(
25                Transform2D::new()
26                    .with_offset(838_200, 838_200)
27                    .with_extent(6_000_000, 1_500_000),
28            ),
29        )
30        .with_text_body(
31            TextBody::new().with_paragraph(
32                TextParagraph::new()
33                    .with_properties(
34                        TextParagraphProperties::new()
35                            .with_line_spacing(TextSpacing::Percent(150_000))
36                            .with_space_before(TextSpacing::Points(1200))
37                            .with_indent_emu(457_200)
38                            .with_level(1),
39                    )
40                    .with_run(TextRun::text(
41                        "Indented, 150% line spacing, 12pt space before.",
42                    )),
43            ),
44        );
45
46    let bullets_shape = AutoShape::new(2, "Bullets")
47        .with_properties(
48            ShapeProperties::new().with_transform(
49                Transform2D::new()
50                    .with_offset(838_200, 838_200)
51                    .with_extent(6_000_000, 1_800_000),
52            ),
53        )
54        .with_text_body(
55            TextBody::new()
56                .with_paragraph(
57                    TextParagraph::new()
58                        .with_properties(
59                            TextParagraphProperties::new()
60                                .with_bullet(BulletKind::Character("\u{2022}".to_string())),
61                        )
62                        .with_run(TextRun::text("Bulleted item")),
63                )
64                .with_paragraph(
65                    TextParagraph::new()
66                        .with_properties(TextParagraphProperties::new().with_bullet(
67                            BulletKind::AutoNumber {
68                                scheme: "arabicPeriod".to_string(),
69                                start_at: None,
70                            },
71                        ))
72                        .with_run(TextRun::text("Auto-numbered item")),
73                ),
74        );
75
76    let autofit_shape = AutoShape::new(2, "Autofit")
77        .with_text_box(true)
78        .with_properties(
79            ShapeProperties::new().with_transform(
80                Transform2D::new()
81                    .with_offset(838_200, 838_200)
82                    .with_extent(4_000_000, 1_000_000),
83            ),
84        )
85        .with_text_body(
86            TextBody::new()
87                .with_properties(
88                    TextBodyProperties::new()
89                        .with_autofit(TextAutofit::Shape)
90                        .with_anchor(TextAnchor::Center)
91                        .with_anchor_center(true),
92                )
93                .with_paragraph(TextParagraph::new().with_run(TextRun::text(
94                    "This shape resizes to fit its text, centered both ways.",
95                ))),
96        );
97
98    let casing_shape = AutoShape::new(2, "Casing")
99        .with_properties(
100            ShapeProperties::new().with_transform(
101                Transform2D::new()
102                    .with_offset(838_200, 838_200)
103                    .with_extent(6_000_000, 1_500_000),
104            ),
105        )
106        .with_text_body(
107            TextBody::new().with_paragraph(
108                TextParagraph::new()
109                    .with_run(TextRun::text_with_properties(
110                        "rendered in all caps, ",
111                        TextRunProperties::new().with_text_caps(TextCaps::All),
112                    ))
113                    .with_run(TextRun::text_with_properties(
114                        "widely spaced, ",
115                        TextRunProperties::new().with_character_spacing_points(3.0),
116                    ))
117                    .with_run(TextRun::text_with_properties(
118                        "highlighted",
119                        TextRunProperties::new().with_highlight(Color::Rgb("FFFF00".to_string())),
120                    ))
121                    .with_run(TextRun::text_with_properties(
122                        "2",
123                        TextRunProperties::new().with_baseline_percent(30.0),
124                    )),
125            ),
126        );
127
128    let field_shape = AutoShape::new(2, "Field")
129        .with_properties(
130            ShapeProperties::new().with_transform(
131                Transform2D::new()
132                    .with_offset(838_200, 838_200)
133                    .with_extent(3_000_000, 500_000),
134            ),
135        )
136        .with_text_body(
137            TextBody::new().with_paragraph(
138                TextParagraph::new()
139                    .with_run(TextRun::text("Slide "))
140                    .with_run(TextRun::field(
141                        "{7A9E3F10-4B6C-4D2E-9A1F-8C5D6E7F0123}",
142                        Some("slidenum".to_string()),
143                        "1",
144                    )),
145            ),
146        );
147
148    let presentation = Presentation::new()
149        .with_slide(Slide::new().with_shape(Shape::AutoShape(spacing_shape)))
150        .with_slide(Slide::new().with_shape(Shape::AutoShape(bullets_shape)))
151        .with_slide(Slide::new().with_shape(Shape::AutoShape(autofit_shape)))
152        .with_slide(Slide::new().with_shape(Shape::AutoShape(casing_shape)))
153        .with_slide(Slide::new().with_shape(Shape::AutoShape(field_shape)));
154
155    presentation.save_to_file(&path)?;
156    println!("Wrote {}", path.display());
157    Ok(())
158}
Source

pub fn with_insets_emu( self, left: i64, top: i64, right: i64, bottom: i64, ) -> TextBodyProperties

Sets all four insets at once, in EMUs.

Source

pub fn with_autofit(self, autofit: TextAutofit) -> TextBodyProperties

Sets how this text body reacts to overflowing content.

Examples found in repository?
examples/pptx_text_formatting.rs (line 89)
19fn main() -> office_toolkit::Result<()> {
20    let path = output_path("pptx_text_formatting.pptx");
21
22    let spacing_shape = AutoShape::new(2, "Spacing")
23        .with_properties(
24            ShapeProperties::new().with_transform(
25                Transform2D::new()
26                    .with_offset(838_200, 838_200)
27                    .with_extent(6_000_000, 1_500_000),
28            ),
29        )
30        .with_text_body(
31            TextBody::new().with_paragraph(
32                TextParagraph::new()
33                    .with_properties(
34                        TextParagraphProperties::new()
35                            .with_line_spacing(TextSpacing::Percent(150_000))
36                            .with_space_before(TextSpacing::Points(1200))
37                            .with_indent_emu(457_200)
38                            .with_level(1),
39                    )
40                    .with_run(TextRun::text(
41                        "Indented, 150% line spacing, 12pt space before.",
42                    )),
43            ),
44        );
45
46    let bullets_shape = AutoShape::new(2, "Bullets")
47        .with_properties(
48            ShapeProperties::new().with_transform(
49                Transform2D::new()
50                    .with_offset(838_200, 838_200)
51                    .with_extent(6_000_000, 1_800_000),
52            ),
53        )
54        .with_text_body(
55            TextBody::new()
56                .with_paragraph(
57                    TextParagraph::new()
58                        .with_properties(
59                            TextParagraphProperties::new()
60                                .with_bullet(BulletKind::Character("\u{2022}".to_string())),
61                        )
62                        .with_run(TextRun::text("Bulleted item")),
63                )
64                .with_paragraph(
65                    TextParagraph::new()
66                        .with_properties(TextParagraphProperties::new().with_bullet(
67                            BulletKind::AutoNumber {
68                                scheme: "arabicPeriod".to_string(),
69                                start_at: None,
70                            },
71                        ))
72                        .with_run(TextRun::text("Auto-numbered item")),
73                ),
74        );
75
76    let autofit_shape = AutoShape::new(2, "Autofit")
77        .with_text_box(true)
78        .with_properties(
79            ShapeProperties::new().with_transform(
80                Transform2D::new()
81                    .with_offset(838_200, 838_200)
82                    .with_extent(4_000_000, 1_000_000),
83            ),
84        )
85        .with_text_body(
86            TextBody::new()
87                .with_properties(
88                    TextBodyProperties::new()
89                        .with_autofit(TextAutofit::Shape)
90                        .with_anchor(TextAnchor::Center)
91                        .with_anchor_center(true),
92                )
93                .with_paragraph(TextParagraph::new().with_run(TextRun::text(
94                    "This shape resizes to fit its text, centered both ways.",
95                ))),
96        );
97
98    let casing_shape = AutoShape::new(2, "Casing")
99        .with_properties(
100            ShapeProperties::new().with_transform(
101                Transform2D::new()
102                    .with_offset(838_200, 838_200)
103                    .with_extent(6_000_000, 1_500_000),
104            ),
105        )
106        .with_text_body(
107            TextBody::new().with_paragraph(
108                TextParagraph::new()
109                    .with_run(TextRun::text_with_properties(
110                        "rendered in all caps, ",
111                        TextRunProperties::new().with_text_caps(TextCaps::All),
112                    ))
113                    .with_run(TextRun::text_with_properties(
114                        "widely spaced, ",
115                        TextRunProperties::new().with_character_spacing_points(3.0),
116                    ))
117                    .with_run(TextRun::text_with_properties(
118                        "highlighted",
119                        TextRunProperties::new().with_highlight(Color::Rgb("FFFF00".to_string())),
120                    ))
121                    .with_run(TextRun::text_with_properties(
122                        "2",
123                        TextRunProperties::new().with_baseline_percent(30.0),
124                    )),
125            ),
126        );
127
128    let field_shape = AutoShape::new(2, "Field")
129        .with_properties(
130            ShapeProperties::new().with_transform(
131                Transform2D::new()
132                    .with_offset(838_200, 838_200)
133                    .with_extent(3_000_000, 500_000),
134            ),
135        )
136        .with_text_body(
137            TextBody::new().with_paragraph(
138                TextParagraph::new()
139                    .with_run(TextRun::text("Slide "))
140                    .with_run(TextRun::field(
141                        "{7A9E3F10-4B6C-4D2E-9A1F-8C5D6E7F0123}",
142                        Some("slidenum".to_string()),
143                        "1",
144                    )),
145            ),
146        );
147
148    let presentation = Presentation::new()
149        .with_slide(Slide::new().with_shape(Shape::AutoShape(spacing_shape)))
150        .with_slide(Slide::new().with_shape(Shape::AutoShape(bullets_shape)))
151        .with_slide(Slide::new().with_shape(Shape::AutoShape(autofit_shape)))
152        .with_slide(Slide::new().with_shape(Shape::AutoShape(casing_shape)))
153        .with_slide(Slide::new().with_shape(Shape::AutoShape(field_shape)));
154
155    presentation.save_to_file(&path)?;
156    println!("Wrote {}", path.display());
157    Ok(())
158}
Source

pub fn with_vertical_direction( self, direction: TextVerticalType, ) -> TextBodyProperties

Sets the text’s reading direction within its shape.

Source

pub fn with_rotation_degrees(self, degrees: f64) -> TextBodyProperties

Rotates the text within its shape, given in ordinary degrees (converted to the schema’s 60,000ths-of-a-degree unit internally).

Trait Implementations§

Source§

impl Clone for TextBodyProperties

Source§

fn clone(&self) -> TextBodyProperties

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for TextBodyProperties

Source§

impl Debug for TextBodyProperties

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for TextBodyProperties

Source§

fn default() -> TextBodyProperties

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

impl Eq for TextBodyProperties

Source§

impl PartialEq for TextBodyProperties

Source§

fn eq(&self, other: &TextBodyProperties) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TextBodyProperties

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
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.