Write documentation for iced_core

This commit is contained in:
Héctor Ramón Jiménez 2019-11-18 07:16:19 +01:00
parent 63dbf078fe
commit d3553adf27
16 changed files with 216 additions and 44 deletions

View file

@ -12,6 +12,7 @@ use crate::{Color, Font, Length};
/// .size(40);
/// ```
#[derive(Debug, Clone)]
#[allow(missing_docs)]
pub struct Text {
pub content: String,
pub size: Option<u16>,
@ -48,14 +49,19 @@ impl Text {
self
}
/// Sets the `Color` of the [`Text`].
/// Sets the [`Color`] of the [`Text`].
///
/// [`Text`]: struct.Text.html
/// [`Color`]: ../../struct.Color.html
pub fn color<C: Into<Color>>(mut self, color: C) -> Self {
self.color = Some(color.into());
self
}
/// Sets the [`Font`] of the [`Text`].
///
/// [`Text`]: struct.Text.html
/// [`Font`]: ../../struct.Font.html
pub fn font(mut self, font: Font) -> Self {
self.font = font;
self