summaryrefslogtreecommitdiffstats
path: root/src/sandbox.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-11-26 02:52:34 +0100
committerLibravatar GitHub <noreply@github.com>2020-11-26 02:52:34 +0100
commit1f7e8b7f3d1804c39c8e0934b25f3ef178de269c (patch)
tree380d9224b81537e460ea7f9fe84c0c912d3f4cbf /src/sandbox.rs
parentbffaeed9fd44619491c012cd9270043828c1849c (diff)
parent01322f69a406eee76014f5e2834336e2295ad80e (diff)
downloadiced-1f7e8b7f3d1804c39c8e0934b25f3ef178de269c.tar.gz
iced-1f7e8b7f3d1804c39c8e0934b25f3ef178de269c.tar.bz2
iced-1f7e8b7f3d1804c39c8e0934b25f3ef178de269c.zip
Merge pull request #632 from hecrj/improvement/update-docs
Use intra-doc links
Diffstat (limited to 'src/sandbox.rs')
-rw-r--r--src/sandbox.rs24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/sandbox.rs b/src/sandbox.rs
index 5a668e39..3de1cebb 100644
--- a/src/sandbox.rs
+++ b/src/sandbox.rs
@@ -14,11 +14,6 @@ use crate::{
/// Therefore, it is recommended to always start by implementing this trait and
/// upgrade only once necessary.
///
-/// [`Application`]: trait.Application.html
-/// [`Sandbox`]: trait.Sandbox.html
-/// [`Command`]: struct.Command.html
-/// [`Command::none`]: struct.Command.html#method.none
-///
/// # Examples
/// [The repository has a bunch of examples] that use the [`Sandbox`] trait:
///
@@ -53,7 +48,7 @@ use crate::{
/// [`lyon`]: https://github.com/nical/lyon
/// [the overview]: index.html#overview
/// [`iced_wgpu`]: https://github.com/hecrj/iced/tree/0.1/wgpu
-/// [`Svg` widget]: widget/svg/struct.Svg.html
+/// [`Svg` widget]: crate::widget::Svg
/// [Ghostscript Tiger]: https://commons.wikimedia.org/wiki/File:Ghostscript_Tiger.svg
///
/// ## A simple "Hello, world!"
@@ -92,46 +87,33 @@ use crate::{
/// ```
pub trait Sandbox {
/// The type of __messages__ your [`Sandbox`] will produce.
- ///
- /// [`Sandbox`]: trait.Sandbox.html
type Message: std::fmt::Debug + Send;
/// Initializes the [`Sandbox`].
///
/// Here is where you should return the initial state of your app.
- ///
- /// [`Sandbox`]: trait.Sandbox.html
fn new() -> Self;
/// Returns the current title of the [`Sandbox`].
///
/// This title can be dynamic! The runtime will automatically update the
/// title of your application when necessary.
- ///
- /// [`Sandbox`]: trait.Sandbox.html
fn title(&self) -> String;
/// Handles a __message__ and updates the state of the [`Sandbox`].
///
/// This is where you define your __update logic__. All the __messages__,
/// produced by user interactions, will be handled by this method.
- ///
- /// [`Sandbox`]: trait.Sandbox.html
fn update(&mut self, message: Self::Message);
/// Returns the widgets to display in the [`Sandbox`].
///
/// These widgets can produce __messages__ based on user interaction.
- ///
- /// [`Sandbox`]: trait.Sandbox.html
fn view(&mut self) -> Element<'_, Self::Message>;
/// Returns the background color of the [`Sandbox`].
///
/// By default, it returns [`Color::WHITE`].
- ///
- /// [`Sandbox`]: trait.Sandbox.html
- /// [`Color::WHITE`]: struct.Color.html#const.WHITE
fn background_color(&self) -> Color {
Color::WHITE
}
@@ -145,8 +127,6 @@ pub trait Sandbox {
/// while a scale factor of `0.5` will shrink them to half their size.
///
/// By default, it returns `1.0`.
- ///
- /// [`Sandbox`]: trait.Sandbox.html
fn scale_factor(&self) -> f64 {
1.0
}
@@ -157,8 +137,6 @@ pub trait Sandbox {
/// and __will NOT return__.
///
/// It should probably be that last thing you call in your `main` function.
- ///
- /// [`Sandbox`]: trait.Sandbox.html
fn run(settings: Settings<()>) -> Result<(), Error>
where
Self: 'static + Sized,