Write missing docs in iced_graphics and iced_wgpu
This commit is contained in:
parent
fa5650cfd1
commit
6921564c9f
8 changed files with 17 additions and 5 deletions
|
|
@ -10,6 +10,7 @@ use std::borrow::Cow;
|
|||
///
|
||||
/// [`Renderer`]: crate::Renderer
|
||||
pub trait Backend {
|
||||
/// The custom kind of primitives this [`Backend`] supports.
|
||||
type Primitive;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ use crate::Primitive;
|
|||
|
||||
use std::sync::Arc;
|
||||
|
||||
/// A type that has some damage bounds.
|
||||
pub trait Damage: PartialEq {
|
||||
/// Returns the bounds of the [`Damage`].
|
||||
fn bounds(&self) -> Rectangle;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ pub use crate::gradient::{self, Gradient};
|
|||
|
||||
/// A renderer capable of drawing some [`Geometry`].
|
||||
pub trait Renderer: crate::core::Renderer {
|
||||
/// The kind of geometry this renderer can draw.
|
||||
type Geometry;
|
||||
|
||||
/// Draws the given layers of [`Geometry`].
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||
)]
|
||||
#![deny(
|
||||
//missing_debug_implementations,
|
||||
//missing_docs,
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
unsafe_code,
|
||||
unused_results,
|
||||
clippy::extra_unused_lifetimes,
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
mod antialiasing;
|
||||
mod error;
|
||||
mod primitive;
|
||||
mod transformation;
|
||||
mod viewport;
|
||||
|
||||
|
|
@ -32,7 +33,6 @@ pub mod compositor;
|
|||
pub mod damage;
|
||||
pub mod gradient;
|
||||
pub mod mesh;
|
||||
pub mod primitive;
|
||||
pub mod renderer;
|
||||
|
||||
#[cfg(feature = "geometry")]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//! Draw triangles!
|
||||
use crate::color;
|
||||
use crate::core::{Rectangle, Size};
|
||||
use crate::gradient;
|
||||
|
|
|
|||
|
|
@ -48,10 +48,12 @@ impl<B: Backend, T> Renderer<B, T> {
|
|||
f(&mut self.backend, &self.primitives)
|
||||
}
|
||||
|
||||
/// Starts recording a new layer.
|
||||
pub fn start_layer(&mut self) -> Vec<Primitive<B::Primitive>> {
|
||||
std::mem::take(&mut self.primitives)
|
||||
}
|
||||
|
||||
/// Ends the recording of a layer.
|
||||
pub fn end_layer(
|
||||
&mut self,
|
||||
primitives: Vec<Primitive<B::Primitive>>,
|
||||
|
|
@ -62,10 +64,12 @@ impl<B: Backend, T> Renderer<B, T> {
|
|||
self.primitives.push(Primitive::group(layer).clip(bounds));
|
||||
}
|
||||
|
||||
/// Starts recording a translation.
|
||||
pub fn start_translation(&mut self) -> Vec<Primitive<B::Primitive>> {
|
||||
std::mem::take(&mut self.primitives)
|
||||
}
|
||||
|
||||
/// Ends the recording of a translation.
|
||||
pub fn end_translation(
|
||||
&mut self,
|
||||
primitives: Vec<Primitive<B::Primitive>>,
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||
)]
|
||||
#![deny(
|
||||
//missing_debug_implementations,
|
||||
//missing_docs,
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
unsafe_code,
|
||||
unused_results,
|
||||
clippy::extra_unused_lifetimes,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
//! Draw using different graphical primitives.
|
||||
use crate::core::Rectangle;
|
||||
use crate::graphics::{Damage, Mesh};
|
||||
|
||||
/// The graphical primitives supported by `iced_wgpu`.
|
||||
pub type Primitive = crate::graphics::Primitive<Custom>;
|
||||
|
||||
/// The custom primitives supported by `iced_wgpu`.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Custom {
|
||||
/// A mesh primitive.
|
||||
Mesh(Mesh),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue