Use recently stabilized intra-doc links
See RFC: https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md
This commit is contained in:
parent
d612bf5678
commit
01322f69a4
135 changed files with 135 additions and 1769 deletions
|
|
@ -11,15 +11,13 @@ use crate::{Color, Command, Element, Executor, Settings, Subscription};
|
|||
/// document.
|
||||
///
|
||||
/// An [`Application`] can execute asynchronous actions by returning a
|
||||
/// [`Command`](struct.Command.html) in some of its methods. If
|
||||
/// you do not intend to perform any background work in your program, the
|
||||
/// [`Sandbox`](trait.Sandbox.html) trait offers a simplified interface.
|
||||
/// [`Command`] in some of its methods. If you do not intend to perform any
|
||||
/// background work in your program, the [`Sandbox`] trait offers a simplified
|
||||
/// interface.
|
||||
///
|
||||
/// When using an [`Application`] with the `debug` feature enabled, a debug view
|
||||
/// can be toggled by pressing `F12`.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
///
|
||||
/// # Examples
|
||||
/// [The repository has a bunch of examples] that use the [`Application`] trait:
|
||||
///
|
||||
|
|
@ -45,9 +43,9 @@ use crate::{Color, Command, Element, Executor, Settings, Subscription};
|
|||
/// [`solar_system`]: https://github.com/hecrj/iced/tree/0.1/examples/solar_system
|
||||
/// [`stopwatch`]: https://github.com/hecrj/iced/tree/0.1/examples/stopwatch
|
||||
/// [`todos`]: https://github.com/hecrj/iced/tree/0.1/examples/todos
|
||||
/// [`Canvas`]: widget/canvas/struct.Canvas.html
|
||||
/// [`Sandbox`]: crate::Sandbox
|
||||
/// [`Canvas`]: crate::widget::Canvas
|
||||
/// [PokéAPI]: https://pokeapi.co/
|
||||
/// [`Subscription`]: type.Subscription.html
|
||||
/// [TodoMVC]: http://todomvc.com/
|
||||
///
|
||||
/// ## A simple "Hello, world!"
|
||||
|
|
@ -91,18 +89,14 @@ pub trait Application: Sized {
|
|||
///
|
||||
/// The [default executor] can be a good starting point!
|
||||
///
|
||||
/// [`Executor`]: trait.Executor.html
|
||||
/// [default executor]: executor/struct.Default.html
|
||||
/// [`Executor`]: Self::Executor
|
||||
/// [default executor]: crate::executor::Default
|
||||
type Executor: Executor;
|
||||
|
||||
/// The type of __messages__ your [`Application`] will produce.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
type Message: std::fmt::Debug + Send;
|
||||
|
||||
/// The data needed to initialize your [`Application`].
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
type Flags;
|
||||
|
||||
/// Initializes the [`Application`] with the flags provided to
|
||||
|
|
@ -110,22 +104,17 @@ pub trait Application: Sized {
|
|||
///
|
||||
/// Here is where you should return the initial state of your app.
|
||||
///
|
||||
/// Additionally, you can return a [`Command`](struct.Command.html) if you
|
||||
/// need to perform some async action in the background on startup. This is
|
||||
/// useful if you want to load state from a file, perform an initial HTTP
|
||||
/// request, etc.
|
||||
/// Additionally, you can return a [`Command`] if you need to perform some
|
||||
/// async action in the background on startup. This is useful if you want to
|
||||
/// load state from a file, perform an initial HTTP request, etc.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
/// [`run`]: #method.run.html
|
||||
/// [`Settings`]: struct.Settings.html
|
||||
/// [`run`]: Self::run
|
||||
fn new(flags: Self::Flags) -> (Self, Command<Self::Message>);
|
||||
|
||||
/// Returns the current title of the [`Application`].
|
||||
///
|
||||
/// This title can be dynamic! The runtime will automatically update the
|
||||
/// title of your application when necessary.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
fn title(&self) -> String;
|
||||
|
||||
/// Handles a __message__ and updates the state of the [`Application`].
|
||||
|
|
@ -135,9 +124,6 @@ pub trait Application: Sized {
|
|||
/// this method.
|
||||
///
|
||||
/// Any [`Command`] returned will be executed immediately in the background.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
/// [`Command`]: struct.Command.html
|
||||
fn update(&mut self, message: Self::Message) -> Command<Self::Message>;
|
||||
|
||||
/// Returns the event [`Subscription`] for the current state of the
|
||||
|
|
@ -148,8 +134,6 @@ pub trait Application: Sized {
|
|||
/// [`update`](#tymethod.update).
|
||||
///
|
||||
/// By default, this method returns an empty [`Subscription`].
|
||||
///
|
||||
/// [`Subscription`]: struct.Subscription.html
|
||||
fn subscription(&self) -> Subscription<Self::Message> {
|
||||
Subscription::none()
|
||||
}
|
||||
|
|
@ -157,8 +141,6 @@ pub trait Application: Sized {
|
|||
/// Returns the widgets to display in the [`Application`].
|
||||
///
|
||||
/// These widgets can produce __messages__ based on user interaction.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
fn view(&mut self) -> Element<'_, Self::Message>;
|
||||
|
||||
/// Returns the current [`Application`] mode.
|
||||
|
|
@ -169,8 +151,6 @@ pub trait Application: Sized {
|
|||
/// Currently, the mode only has an effect in native platforms.
|
||||
///
|
||||
/// By default, an application will run in windowed mode.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
fn mode(&self) -> window::Mode {
|
||||
window::Mode::Windowed
|
||||
}
|
||||
|
|
@ -178,9 +158,6 @@ pub trait Application: Sized {
|
|||
/// Returns the background color of the [`Application`].
|
||||
///
|
||||
/// By default, it returns [`Color::WHITE`].
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
/// [`Color::WHITE`]: struct.Color.html#const.WHITE
|
||||
fn background_color(&self) -> Color {
|
||||
Color::WHITE
|
||||
}
|
||||
|
|
@ -194,8 +171,6 @@ pub trait Application: Sized {
|
|||
/// while a scale factor of `0.5` will shrink them to half their size.
|
||||
///
|
||||
/// By default, it returns `1.0`.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
fn scale_factor(&self) -> f64 {
|
||||
1.0
|
||||
}
|
||||
|
|
@ -207,8 +182,7 @@ pub trait Application: Sized {
|
|||
///
|
||||
/// It should probably be that last thing you call in your `main` function.
|
||||
///
|
||||
/// [`Application`]: trait.Application.html
|
||||
/// [`Error`]: enum.Error.html
|
||||
/// [`Error`]: crate::Error
|
||||
fn run(settings: Settings<Self::Flags>) -> crate::Result
|
||||
where
|
||||
Self: 'static,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue