vello_encoding 0.8.0

Vello types that represent the data that needs to be rendered.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2022 the Vello Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

/// Interface for a monoid. The default value must be the identity of
/// the monoid.
pub trait Monoid: Default {
    /// The source value for constructing the monoid.
    type SourceValue;

    /// Creates a monoid from a given value.
    fn new(value: Self::SourceValue) -> Self;

    /// Combines two monoids. This operation must be associative.
    #[must_use]
    fn combine(&self, other: &Self) -> Self;
}