pub struct Style {Show 32 fields
pub id: String,
pub name: String,
pub kind: StyleKind,
pub based_on: Option<String>,
pub bold: bool,
pub italic: bool,
pub underline: Option<UnderlineStyle>,
pub underline_color: Option<String>,
pub color: Option<String>,
pub font_size: Option<u16>,
pub font_family: Option<String>,
pub highlight: Option<Highlight>,
pub strike: bool,
pub vertical_align: Option<VerticalAlign>,
pub small_caps: bool,
pub all_caps: bool,
pub shading_color: Option<String>,
pub text_border: bool,
pub character_spacing: Option<i16>,
pub vertical_position: Option<i16>,
pub hidden: bool,
pub alignment: Option<Alignment>,
pub line_spacing: Option<u32>,
pub space_before: Option<u32>,
pub space_after: Option<u32>,
pub paragraph_shading_color: Option<String>,
pub paragraph_border: bool,
pub keep_with_next: bool,
pub keep_lines_together: bool,
pub page_break_before: bool,
pub tabs: Vec<TabStop>,
pub contextual_spacing: bool,
}Expand description
A named style declared in word/styles.xml (CT_Style), applied to paragraphs or runs by id
(Paragraph.style_id/Run.style_id).
Only the handful of fields covering the common case — a name, an optional base style to inherit
from, and the same character/paragraph formatting already modeled on Run/Paragraph — are
modeled. CT_Style has many more (next, link, hidden, uiPriority, table-style-specific
properties..), out of scope for now; a style marked as the type’s default (CT_Style’s
default attribute) isn’t modeled either — Word falls back to its own built-in default when
none is declared, which is sufficient for a first version.
Fields§
§id: StringThe style’s id (w:styleId), referenced by Paragraph.style_id/ Run.style_id.
name: StringThe style’s human-readable name (w:name), shown in Word’s style picker.
kind: StyleKindWhether this is a paragraph or character style (w:type, ST_StyleType — only these two of
its four values are modeled; table/numbering styles are out of scope for now).
based_on: Option<String>The id of another style this one inherits from (w:basedOn), or None.
bold: boolWhether text in this style is bold. Meaningful for both style kinds: a paragraph style’s run formatting is the default for text typed in that paragraph, unless a run/character style overrides it.
italic: boolWhether text in this style is italic.
underline: Option<UnderlineStyle>This style’s underline style, mirroring Run.underline.
underline_color: Option<String>This style’s underline color, mirroring Run.underline_color.
color: Option<String>This style’s text color, mirroring Run.color — see that field’s doc comment.
font_size: Option<u16>This style’s font size in whole points, mirroring Run.font_size.
font_family: Option<String>This style’s font family/typeface, mirroring Run.font_family.
highlight: Option<Highlight>This style’s highlight color, mirroring Run.highlight.
strike: boolWhether text in this style is struck through, mirroring Run.strike.
vertical_align: Option<VerticalAlign>This style’s vertical alignment, mirroring Run.vertical_align.
small_caps: boolWhether text in this style is displayed as small caps, mirroring Run.small_caps.
all_caps: boolWhether text in this style is displayed as all caps, mirroring Run.all_caps.
shading_color: Option<String>This style’s background shading color, mirroring Run.shading_color.
text_border: boolWhether text in this style has a border, mirroring Run.text_border.
character_spacing: Option<i16>This style’s character spacing adjustment, mirroring Run.character_spacing.
vertical_position: Option<i16>This style’s vertical position, mirroring Run.vertical_position.
Whether text in this style is hidden, mirroring Run.hidden.
alignment: Option<Alignment>The paragraph alignment this style sets. Only meaningful for StyleKind::Paragraph;
ignored (not written) for a character style, which has no paragraph-level formatting of its
own.
line_spacing: Option<u32>This style’s line spacing, mirroring Paragraph.line_spacing. Only meaningful for
StyleKind::Paragraph, same restriction as alignment.
space_before: Option<u32>This style’s extra space before a paragraph, mirroring Paragraph.space_before. Only
meaningful for StyleKind::Paragraph.
space_after: Option<u32>This style’s extra space after a paragraph, mirroring Paragraph.space_after. Only
meaningful for StyleKind::Paragraph.
paragraph_shading_color: Option<String>This style’s paragraph background shading color, mirroring Paragraph.shading_color.
Distinct from shading_color above (that one mirrors Run.shading_color, a run-level
w:shd inside w:rPr) — this is the paragraph-level w:shd inside w:pPr; a paragraph
style can carry both at once (default run shading AND a paragraph background), which is why
they need separate fields. Only meaningful for StyleKind::Paragraph.
paragraph_border: boolWhether this style draws a border around the paragraph, mirroring Paragraph.border.
Distinct from text_border above for the same reason as paragraph_shading_color vs.
shading_color — a paragraph-level w:pBdr inside w:pPr, not the run-level w:bdr
inside w:rPr. Only meaningful for StyleKind::Paragraph.
keep_with_next: boolThis style’s keep-with-next setting, mirroring Paragraph.keep_with_next. Only meaningful
for StyleKind::Paragraph — commonly set directly on a built-in “Heading” style rather
than on every individual heading paragraph.
keep_lines_together: boolThis style’s keep-lines-together setting, mirroring Paragraph.keep_lines_together. Only
meaningful for StyleKind::Paragraph.
page_break_before: boolThis style’s page-break-before setting, mirroring Paragraph.page_break_before. Only
meaningful for StyleKind::Paragraph.
tabs: Vec<TabStop>This style’s custom tab stops, mirroring Paragraph.tabs. Only meaningful for
StyleKind::Paragraph.
contextual_spacing: boolThis style’s contextual-spacing setting, mirroring Paragraph.contextual_spacing. Only
meaningful for StyleKind::Paragraph — this is exactly the property Word’s own built-in
“List Paragraph” style sets, so consecutive list items don’t get extra gaps between them.
Implementations§
Source§impl Style
impl Style
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
kind: StyleKind,
) -> Style
pub fn new( id: impl Into<String>, name: impl Into<String>, kind: StyleKind, ) -> Style
Creates a style with the given id, display name and kind, and no formatting.
Examples found in repository?
13fn main() -> office_toolkit::Result<()> {
14 let path = output_path("docx_styles_and_lists.docx");
15
16 let heading_style = Style::new("Heading1", "Heading 1", StyleKind::Paragraph)
17 .with_bold(true)
18 .with_font_size(32);
19 let emphasis_style = Style::new("StrongEmphasis", "Strong Emphasis", StyleKind::Character)
20 .with_bold(true)
21 .with_color("C00000");
22
23 let bulleted = NumberingDefinition::bullet(1);
24 let numbered = NumberingDefinition::decimal(2);
25 let custom = NumberingDefinition::new(
26 3,
27 vec![
28 ListLevel::new(NumberFormat::UpperRoman, "%1.", 720, 360),
29 ListLevel::new(NumberFormat::LowerLetter, "%2)", 1440, 360),
30 ],
31 );
32
33 let document = Document::new()
34 .with_style(heading_style)
35 .with_style(emphasis_style)
36 .with_numbering_definition(bulleted)
37 .with_numbering_definition(numbered)
38 .with_numbering_definition(custom)
39 .with_paragraph(heading("Named paragraph and character styles", false))
40 .with_paragraph(
41 Paragraph::with_text("This paragraph uses the Heading 1 style.")
42 .with_style_id("Heading1"),
43 )
44 .with_paragraph(
45 Paragraph::new()
46 .with_run(Run::new("Plain text, then "))
47 .with_run(Run::new("some strongly emphasized text").with_style_id("StrongEmphasis"))
48 .with_run(Run::new(", then plain text again.")),
49 )
50 .with_paragraph(heading("Bulleted list", true))
51 .with_paragraph(Paragraph::with_text("First item").with_numbering(1, 0))
52 .with_paragraph(Paragraph::with_text("Second item").with_numbering(1, 0))
53 .with_paragraph(Paragraph::with_text("A sub-item, one level deeper").with_numbering(1, 1))
54 .with_paragraph(heading("Numbered list", true))
55 .with_paragraph(Paragraph::with_text("First step").with_numbering(2, 0))
56 .with_paragraph(Paragraph::with_text("Second step").with_numbering(2, 0))
57 .with_paragraph(
58 Paragraph::with_text("A sub-step, cumulatively numbered").with_numbering(2, 1),
59 )
60 .with_paragraph(heading(
61 "Custom multi-level list (roman numerals, then letters)",
62 true,
63 ))
64 .with_paragraph(Paragraph::with_text("First top-level item").with_numbering(3, 0))
65 .with_paragraph(Paragraph::with_text("A lettered sub-item").with_numbering(3, 1))
66 .with_paragraph(Paragraph::with_text("Second top-level item").with_numbering(3, 0));
67
68 document.save_to_file(&path)?;
69 println!("Wrote {}", path.display());
70 Ok(())
71}Sourcepub fn with_based_on(self, style_id: impl Into<String>) -> Style
pub fn with_based_on(self, style_id: impl Into<String>) -> Style
Sets the style this one inherits from (by id) and returns it for chaining.
Sourcepub fn with_bold(self, bold: bool) -> Style
pub fn with_bold(self, bold: bool) -> Style
Sets whether text in this style is bold and returns it for chaining.
Examples found in repository?
13fn main() -> office_toolkit::Result<()> {
14 let path = output_path("docx_styles_and_lists.docx");
15
16 let heading_style = Style::new("Heading1", "Heading 1", StyleKind::Paragraph)
17 .with_bold(true)
18 .with_font_size(32);
19 let emphasis_style = Style::new("StrongEmphasis", "Strong Emphasis", StyleKind::Character)
20 .with_bold(true)
21 .with_color("C00000");
22
23 let bulleted = NumberingDefinition::bullet(1);
24 let numbered = NumberingDefinition::decimal(2);
25 let custom = NumberingDefinition::new(
26 3,
27 vec![
28 ListLevel::new(NumberFormat::UpperRoman, "%1.", 720, 360),
29 ListLevel::new(NumberFormat::LowerLetter, "%2)", 1440, 360),
30 ],
31 );
32
33 let document = Document::new()
34 .with_style(heading_style)
35 .with_style(emphasis_style)
36 .with_numbering_definition(bulleted)
37 .with_numbering_definition(numbered)
38 .with_numbering_definition(custom)
39 .with_paragraph(heading("Named paragraph and character styles", false))
40 .with_paragraph(
41 Paragraph::with_text("This paragraph uses the Heading 1 style.")
42 .with_style_id("Heading1"),
43 )
44 .with_paragraph(
45 Paragraph::new()
46 .with_run(Run::new("Plain text, then "))
47 .with_run(Run::new("some strongly emphasized text").with_style_id("StrongEmphasis"))
48 .with_run(Run::new(", then plain text again.")),
49 )
50 .with_paragraph(heading("Bulleted list", true))
51 .with_paragraph(Paragraph::with_text("First item").with_numbering(1, 0))
52 .with_paragraph(Paragraph::with_text("Second item").with_numbering(1, 0))
53 .with_paragraph(Paragraph::with_text("A sub-item, one level deeper").with_numbering(1, 1))
54 .with_paragraph(heading("Numbered list", true))
55 .with_paragraph(Paragraph::with_text("First step").with_numbering(2, 0))
56 .with_paragraph(Paragraph::with_text("Second step").with_numbering(2, 0))
57 .with_paragraph(
58 Paragraph::with_text("A sub-step, cumulatively numbered").with_numbering(2, 1),
59 )
60 .with_paragraph(heading(
61 "Custom multi-level list (roman numerals, then letters)",
62 true,
63 ))
64 .with_paragraph(Paragraph::with_text("First top-level item").with_numbering(3, 0))
65 .with_paragraph(Paragraph::with_text("A lettered sub-item").with_numbering(3, 1))
66 .with_paragraph(Paragraph::with_text("Second top-level item").with_numbering(3, 0));
67
68 document.save_to_file(&path)?;
69 println!("Wrote {}", path.display());
70 Ok(())
71}Sourcepub fn with_italic(self, italic: bool) -> Style
pub fn with_italic(self, italic: bool) -> Style
Sets whether text in this style is italic and returns it for chaining.
Sourcepub fn with_underline(self, underline: UnderlineStyle) -> Style
pub fn with_underline(self, underline: UnderlineStyle) -> Style
Sets this style’s underline style and returns it for chaining.
Sourcepub fn with_underline_color(self, underline_color: impl Into<String>) -> Style
pub fn with_underline_color(self, underline_color: impl Into<String>) -> Style
Sets the color of this style’s underline (a 6-digit RGB hex string, no leading #) and
returns it for chaining. Only meaningful once with_underline has also been called.
Sourcepub fn with_color(self, color: impl Into<String>) -> Style
pub fn with_color(self, color: impl Into<String>) -> Style
Sets this style’s text color (a 6-digit RGB hex string, no leading #) and returns it for
chaining.
Examples found in repository?
13fn main() -> office_toolkit::Result<()> {
14 let path = output_path("docx_styles_and_lists.docx");
15
16 let heading_style = Style::new("Heading1", "Heading 1", StyleKind::Paragraph)
17 .with_bold(true)
18 .with_font_size(32);
19 let emphasis_style = Style::new("StrongEmphasis", "Strong Emphasis", StyleKind::Character)
20 .with_bold(true)
21 .with_color("C00000");
22
23 let bulleted = NumberingDefinition::bullet(1);
24 let numbered = NumberingDefinition::decimal(2);
25 let custom = NumberingDefinition::new(
26 3,
27 vec![
28 ListLevel::new(NumberFormat::UpperRoman, "%1.", 720, 360),
29 ListLevel::new(NumberFormat::LowerLetter, "%2)", 1440, 360),
30 ],
31 );
32
33 let document = Document::new()
34 .with_style(heading_style)
35 .with_style(emphasis_style)
36 .with_numbering_definition(bulleted)
37 .with_numbering_definition(numbered)
38 .with_numbering_definition(custom)
39 .with_paragraph(heading("Named paragraph and character styles", false))
40 .with_paragraph(
41 Paragraph::with_text("This paragraph uses the Heading 1 style.")
42 .with_style_id("Heading1"),
43 )
44 .with_paragraph(
45 Paragraph::new()
46 .with_run(Run::new("Plain text, then "))
47 .with_run(Run::new("some strongly emphasized text").with_style_id("StrongEmphasis"))
48 .with_run(Run::new(", then plain text again.")),
49 )
50 .with_paragraph(heading("Bulleted list", true))
51 .with_paragraph(Paragraph::with_text("First item").with_numbering(1, 0))
52 .with_paragraph(Paragraph::with_text("Second item").with_numbering(1, 0))
53 .with_paragraph(Paragraph::with_text("A sub-item, one level deeper").with_numbering(1, 1))
54 .with_paragraph(heading("Numbered list", true))
55 .with_paragraph(Paragraph::with_text("First step").with_numbering(2, 0))
56 .with_paragraph(Paragraph::with_text("Second step").with_numbering(2, 0))
57 .with_paragraph(
58 Paragraph::with_text("A sub-step, cumulatively numbered").with_numbering(2, 1),
59 )
60 .with_paragraph(heading(
61 "Custom multi-level list (roman numerals, then letters)",
62 true,
63 ))
64 .with_paragraph(Paragraph::with_text("First top-level item").with_numbering(3, 0))
65 .with_paragraph(Paragraph::with_text("A lettered sub-item").with_numbering(3, 1))
66 .with_paragraph(Paragraph::with_text("Second top-level item").with_numbering(3, 0));
67
68 document.save_to_file(&path)?;
69 println!("Wrote {}", path.display());
70 Ok(())
71}Sourcepub fn with_font_size(self, font_size: u16) -> Style
pub fn with_font_size(self, font_size: u16) -> Style
Sets this style’s font size in whole points and returns it for chaining.
Examples found in repository?
13fn main() -> office_toolkit::Result<()> {
14 let path = output_path("docx_styles_and_lists.docx");
15
16 let heading_style = Style::new("Heading1", "Heading 1", StyleKind::Paragraph)
17 .with_bold(true)
18 .with_font_size(32);
19 let emphasis_style = Style::new("StrongEmphasis", "Strong Emphasis", StyleKind::Character)
20 .with_bold(true)
21 .with_color("C00000");
22
23 let bulleted = NumberingDefinition::bullet(1);
24 let numbered = NumberingDefinition::decimal(2);
25 let custom = NumberingDefinition::new(
26 3,
27 vec![
28 ListLevel::new(NumberFormat::UpperRoman, "%1.", 720, 360),
29 ListLevel::new(NumberFormat::LowerLetter, "%2)", 1440, 360),
30 ],
31 );
32
33 let document = Document::new()
34 .with_style(heading_style)
35 .with_style(emphasis_style)
36 .with_numbering_definition(bulleted)
37 .with_numbering_definition(numbered)
38 .with_numbering_definition(custom)
39 .with_paragraph(heading("Named paragraph and character styles", false))
40 .with_paragraph(
41 Paragraph::with_text("This paragraph uses the Heading 1 style.")
42 .with_style_id("Heading1"),
43 )
44 .with_paragraph(
45 Paragraph::new()
46 .with_run(Run::new("Plain text, then "))
47 .with_run(Run::new("some strongly emphasized text").with_style_id("StrongEmphasis"))
48 .with_run(Run::new(", then plain text again.")),
49 )
50 .with_paragraph(heading("Bulleted list", true))
51 .with_paragraph(Paragraph::with_text("First item").with_numbering(1, 0))
52 .with_paragraph(Paragraph::with_text("Second item").with_numbering(1, 0))
53 .with_paragraph(Paragraph::with_text("A sub-item, one level deeper").with_numbering(1, 1))
54 .with_paragraph(heading("Numbered list", true))
55 .with_paragraph(Paragraph::with_text("First step").with_numbering(2, 0))
56 .with_paragraph(Paragraph::with_text("Second step").with_numbering(2, 0))
57 .with_paragraph(
58 Paragraph::with_text("A sub-step, cumulatively numbered").with_numbering(2, 1),
59 )
60 .with_paragraph(heading(
61 "Custom multi-level list (roman numerals, then letters)",
62 true,
63 ))
64 .with_paragraph(Paragraph::with_text("First top-level item").with_numbering(3, 0))
65 .with_paragraph(Paragraph::with_text("A lettered sub-item").with_numbering(3, 1))
66 .with_paragraph(Paragraph::with_text("Second top-level item").with_numbering(3, 0));
67
68 document.save_to_file(&path)?;
69 println!("Wrote {}", path.display());
70 Ok(())
71}Sourcepub fn with_font_family(self, font_family: impl Into<String>) -> Style
pub fn with_font_family(self, font_family: impl Into<String>) -> Style
Sets this style’s font family/typeface and returns it for chaining.
Sourcepub fn with_highlight(self, highlight: Highlight) -> Style
pub fn with_highlight(self, highlight: Highlight) -> Style
Sets this style’s highlight color and returns it for chaining.
Sourcepub fn with_strike(self, strike: bool) -> Style
pub fn with_strike(self, strike: bool) -> Style
Sets whether text in this style is struck through and returns it for chaining.
Sourcepub fn with_vertical_align(self, vertical_align: VerticalAlign) -> Style
pub fn with_vertical_align(self, vertical_align: VerticalAlign) -> Style
Sets this style’s vertical alignment (superscript/subscript) and returns it for chaining.
Sourcepub fn with_small_caps(self, small_caps: bool) -> Style
pub fn with_small_caps(self, small_caps: bool) -> Style
Sets whether text in this style is displayed as small caps and returns it for chaining.
Sourcepub fn with_all_caps(self, all_caps: bool) -> Style
pub fn with_all_caps(self, all_caps: bool) -> Style
Sets whether text in this style is displayed as all caps and returns it for chaining.
Sourcepub fn with_shading_color(self, shading_color: impl Into<String>) -> Style
pub fn with_shading_color(self, shading_color: impl Into<String>) -> Style
Sets this style’s background shading color (a 6-digit RGB hex string, no leading #) and
returns it for chaining.
Sourcepub fn with_text_border(self, text_border: bool) -> Style
pub fn with_text_border(self, text_border: bool) -> Style
Sets whether text in this style has a border and returns it for chaining.
Sourcepub fn with_character_spacing(self, character_spacing: i16) -> Style
pub fn with_character_spacing(self, character_spacing: i16) -> Style
Sets this style’s character spacing adjustment, in twips, and returns it for chaining.
Sourcepub fn with_vertical_position(self, vertical_position: i16) -> Style
pub fn with_vertical_position(self, vertical_position: i16) -> Style
Sets this style’s vertical position, raised or lowered from the baseline, in half-points, and returns it for chaining.
Sets whether text in this style is hidden and returns it for chaining.
Sourcepub fn with_alignment(self, alignment: Alignment) -> Style
pub fn with_alignment(self, alignment: Alignment) -> Style
Sets this style’s paragraph alignment and returns it for chaining. Only meaningful for
StyleKind::Paragraph — see the field’s doc comment.
Sourcepub fn with_line_spacing(self, line_spacing: u32) -> Style
pub fn with_line_spacing(self, line_spacing: u32) -> Style
Sets this style’s line spacing (in w:spacing’s “auto” units — see
Paragraph.line_spacing’s doc comment) and returns it for chaining. Only meaningful for
StyleKind::Paragraph.
Sourcepub fn with_space_before(self, space_before: u32) -> Style
pub fn with_space_before(self, space_before: u32) -> Style
Sets this style’s extra space before a paragraph, in twips, and returns it for chaining.
Only meaningful for StyleKind::Paragraph.
Sourcepub fn with_space_after(self, space_after: u32) -> Style
pub fn with_space_after(self, space_after: u32) -> Style
Sets this style’s extra space after a paragraph, in twips, and returns it for chaining. Only
meaningful for StyleKind::Paragraph.
Sourcepub fn with_paragraph_shading_color(
self,
paragraph_shading_color: impl Into<String>,
) -> Style
pub fn with_paragraph_shading_color( self, paragraph_shading_color: impl Into<String>, ) -> Style
Sets this style’s paragraph background shading color and returns it for chaining. Only
meaningful for StyleKind::Paragraph — see paragraph_shading_color’s doc comment for
how this differs from with_shading_color.
Sourcepub fn with_paragraph_border(self, paragraph_border: bool) -> Style
pub fn with_paragraph_border(self, paragraph_border: bool) -> Style
Sets whether this style draws a border around the paragraph and returns it for chaining.
Only meaningful for StyleKind::Paragraph — see paragraph_border’s doc comment for how
this differs from with_text_border.
Sourcepub fn with_keep_with_next(self, keep_with_next: bool) -> Style
pub fn with_keep_with_next(self, keep_with_next: bool) -> Style
Sets whether this style keeps its paragraph on the same page as the one following it and
returns it for chaining. Only meaningful for StyleKind::Paragraph. See
keep_with_next’s doc comment.
Sourcepub fn with_keep_lines_together(self, keep_lines_together: bool) -> Style
pub fn with_keep_lines_together(self, keep_lines_together: bool) -> Style
Sets whether this style keeps its paragraph’s lines together on the same page and returns it
for chaining. Only meaningful for StyleKind::Paragraph. See keep_lines_together’s doc
comment.
Sourcepub fn with_page_break_before(self, page_break_before: bool) -> Style
pub fn with_page_break_before(self, page_break_before: bool) -> Style
Sets whether this style forces a page break before its paragraph and returns it for
chaining. Only meaningful for StyleKind::Paragraph. See page_break_before’s doc
comment.
Sourcepub fn with_tab(self, tab: TabStop) -> Style
pub fn with_tab(self, tab: TabStop) -> Style
Appends a custom tab stop and returns this style for chaining. Only meaningful for
StyleKind::Paragraph. See tabs’s doc comment.
Sourcepub fn with_contextual_spacing(self, contextual_spacing: bool) -> Style
pub fn with_contextual_spacing(self, contextual_spacing: bool) -> Style
Sets whether this style ignores spacing above/below when adjacent to a paragraph sharing the
same style and returns it for chaining. Only meaningful for StyleKind::Paragraph. See
contextual_spacing’s doc comment.
Trait Implementations§
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.