Add documentation to many parts of the Rust codebase (#552)

* add lots of doccomments

* add conversion traits from layerdatatypes to layers

* add suggested doc improvements

* Code review changes

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Alaska
2022-04-09 08:56:58 +02:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 1455ac3dce
commit 5c99cdef7f
13 changed files with 470 additions and 21 deletions
+4
View File
@@ -1,5 +1,7 @@
use serde::{Deserialize, Serialize};
/// Describes how overlapping SVG elements should be blended together.
/// See the [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/CSS/blend-mode#examples) for examples.
#[derive(PartialEq, Copy, Clone, Debug, Serialize, Deserialize)]
pub enum BlendMode {
Normal,
@@ -21,6 +23,8 @@ pub enum BlendMode {
}
impl BlendMode {
/// Convert the enum to the CSS string for the blend mode.
/// [Read more](https://developer.mozilla.org/en-US/docs/Web/CSS/blend-mode#values)
pub fn to_svg_style_name(&self) -> &str {
match self {
BlendMode::Normal => "normal",