Merge pull request #259 from robjtede/docs/feature-flags
reference feature flags in docs
This commit is contained in:
		
						commit
						ad0a6c4c10
					
				| @ -65,3 +65,7 @@ iced_wgpu = { version = "0.2", path = "wgpu" } | |||||||
| 
 | 
 | ||||||
| [target.'cfg(target_arch = "wasm32")'.dependencies] | [target.'cfg(target_arch = "wasm32")'.dependencies] | ||||||
| iced_web = { version = "0.2", path = "web" } | iced_web = { version = "0.2", path = "web" } | ||||||
|  | 
 | ||||||
|  | [package.metadata.docs.rs] | ||||||
|  | rustdoc-args = ["--cfg", "docsrs"] | ||||||
|  | features = ["image", "svg", "canvas"] | ||||||
|  | |||||||
| @ -30,3 +30,7 @@ optional = true | |||||||
| 
 | 
 | ||||||
| [target.'cfg(target_arch = "wasm32")'.dependencies] | [target.'cfg(target_arch = "wasm32")'.dependencies] | ||||||
| wasm-bindgen-futures = "0.4" | wasm-bindgen-futures = "0.4" | ||||||
|  | 
 | ||||||
|  | [package.metadata.docs.rs] | ||||||
|  | rustdoc-args = ["--cfg", "docsrs"] | ||||||
|  | all-features = true | ||||||
|  | |||||||
| @ -3,6 +3,7 @@ use crate::Executor; | |||||||
| use futures::Future; | use futures::Future; | ||||||
| 
 | 
 | ||||||
| /// An `async-std` runtime.
 | /// An `async-std` runtime.
 | ||||||
|  | #[cfg_attr(docsrs, doc(cfg(feature = "async-std")))] | ||||||
| #[derive(Debug)] | #[derive(Debug)] | ||||||
| pub struct AsyncStd; | pub struct AsyncStd; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,6 +3,7 @@ use crate::Executor; | |||||||
| use futures::Future; | use futures::Future; | ||||||
| 
 | 
 | ||||||
| /// A thread pool runtime for futures.
 | /// A thread pool runtime for futures.
 | ||||||
|  | #[cfg_attr(docsrs, doc(cfg(feature = "thread-pool")))] | ||||||
| pub type ThreadPool = futures::executor::ThreadPool; | pub type ThreadPool = futures::executor::ThreadPool; | ||||||
| 
 | 
 | ||||||
| impl Executor for futures::executor::ThreadPool { | impl Executor for futures::executor::ThreadPool { | ||||||
|  | |||||||
| @ -3,6 +3,7 @@ use crate::Executor; | |||||||
| use futures::Future; | use futures::Future; | ||||||
| 
 | 
 | ||||||
| /// A `tokio` runtime.
 | /// A `tokio` runtime.
 | ||||||
|  | #[cfg_attr(docsrs, doc(cfg(feature = "tokio")))] | ||||||
| pub type Tokio = tokio::runtime::Runtime; | pub type Tokio = tokio::runtime::Runtime; | ||||||
| 
 | 
 | ||||||
| impl Executor for Tokio { | impl Executor for Tokio { | ||||||
|  | |||||||
| @ -4,6 +4,8 @@ | |||||||
| #![deny(unused_results)] | #![deny(unused_results)] | ||||||
| #![forbid(unsafe_code)] | #![forbid(unsafe_code)] | ||||||
| #![forbid(rust_2018_idioms)] | #![forbid(rust_2018_idioms)] | ||||||
|  | #![cfg_attr(docsrs, feature(doc_cfg))] | ||||||
|  | 
 | ||||||
| pub use futures; | pub use futures; | ||||||
| 
 | 
 | ||||||
| mod command; | mod command; | ||||||
|  | |||||||
| @ -178,6 +178,7 @@ | |||||||
| #![deny(unused_results)] | #![deny(unused_results)] | ||||||
| #![forbid(unsafe_code)] | #![forbid(unsafe_code)] | ||||||
| #![forbid(rust_2018_idioms)] | #![forbid(rust_2018_idioms)] | ||||||
|  | #![cfg_attr(docsrs, feature(doc_cfg))] | ||||||
| mod application; | mod application; | ||||||
| mod element; | mod element; | ||||||
| mod sandbox; | mod sandbox; | ||||||
|  | |||||||
| @ -18,13 +18,22 @@ | |||||||
| //! [`text_input::State`]: text_input/struct.State.html
 | //! [`text_input::State`]: text_input/struct.State.html
 | ||||||
| #[cfg(not(target_arch = "wasm32"))] | #[cfg(not(target_arch = "wasm32"))] | ||||||
| mod platform { | mod platform { | ||||||
|     pub use iced_wgpu::widget::*; |     pub use iced_wgpu::widget::{ | ||||||
|  |         button, checkbox, container, pane_grid, progress_bar, radio, | ||||||
|  |         scrollable, slider, text_input, | ||||||
|  |     }; | ||||||
| 
 | 
 | ||||||
|  |     #[cfg(feature = "canvas")] | ||||||
|  |     #[cfg_attr(docsrs, doc(cfg(feature = "canvas")))] | ||||||
|  |     pub use iced_wgpu::widget::canvas; | ||||||
|  | 
 | ||||||
|  |     #[cfg_attr(docsrs, doc(cfg(feature = "image")))] | ||||||
|     pub mod image { |     pub mod image { | ||||||
|         //! Display images in your user interface.
 |         //! Display images in your user interface.
 | ||||||
|         pub use iced_winit::image::{Handle, Image}; |         pub use iced_winit::image::{Handle, Image}; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     #[cfg_attr(docsrs, doc(cfg(feature = "svg")))] | ||||||
|     pub mod svg { |     pub mod svg { | ||||||
|         //! Display vector graphics in your user interface.
 |         //! Display vector graphics in your user interface.
 | ||||||
|         pub use iced_winit::svg::{Handle, Svg}; |         pub use iced_winit::svg::{Handle, Svg}; | ||||||
|  | |||||||
| @ -41,3 +41,7 @@ optional = true | |||||||
| [dependencies.lyon] | [dependencies.lyon] | ||||||
| version = "0.15" | version = "0.15" | ||||||
| optional = true | optional = true | ||||||
|  | 
 | ||||||
|  | [package.metadata.docs.rs] | ||||||
|  | rustdoc-args = ["--cfg", "docsrs"] | ||||||
|  | all-features = true | ||||||
|  | |||||||
| @ -25,6 +25,8 @@ | |||||||
| #![deny(unused_results)] | #![deny(unused_results)] | ||||||
| #![forbid(unsafe_code)] | #![forbid(unsafe_code)] | ||||||
| #![forbid(rust_2018_idioms)] | #![forbid(rust_2018_idioms)] | ||||||
|  | #![cfg_attr(docsrs, feature(doc_cfg))] | ||||||
|  | 
 | ||||||
| pub mod defaults; | pub mod defaults; | ||||||
| pub mod settings; | pub mod settings; | ||||||
| pub mod triangle; | pub mod triangle; | ||||||
|  | |||||||
| @ -37,6 +37,7 @@ pub use slider::Slider; | |||||||
| pub use text_input::TextInput; | pub use text_input::TextInput; | ||||||
| 
 | 
 | ||||||
| #[cfg(feature = "canvas")] | #[cfg(feature = "canvas")] | ||||||
|  | #[cfg_attr(docsrs, doc(cfg(feature = "canvas")))] | ||||||
| pub mod canvas; | pub mod canvas; | ||||||
| 
 | 
 | ||||||
| #[cfg(feature = "canvas")] | #[cfg(feature = "canvas")] | ||||||
|  | |||||||
| @ -172,6 +172,7 @@ impl Frame { | |||||||
|     ///
 |     ///
 | ||||||
|     /// [`Text`]: struct.Text.html
 |     /// [`Text`]: struct.Text.html
 | ||||||
|     /// [`Frame`]: struct.Frame.html
 |     /// [`Frame`]: struct.Frame.html
 | ||||||
|  |     /// [`Canvas`]: struct.Canvas.html
 | ||||||
|     pub fn fill_text(&mut self, text: Text) { |     pub fn fill_text(&mut self, text: Text) { | ||||||
|         use std::f32; |         use std::f32; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user