src/instance.rs

branch
dev
changeset 153
829c07ea584d
parent 150
c4e394a9c84c
child 155
45d03cf92c23
equal deleted inserted replaced
151:402d717bb5c0 153:829c07ea584d
184 /// Helper trait for functions to work with either owned values or references to either the 184 /// Helper trait for functions to work with either owned values or references to either the
185 /// “principal type” `X` or types some present a subset of `X`. In the latter sense, this 185 /// “principal type” `X` or types some present a subset of `X`. In the latter sense, this
186 /// generalises [`std::borrow::ToOwned`], [`std::borrow::Borrow`], and [`std::borrow::Cow`]. 186 /// generalises [`std::borrow::ToOwned`], [`std::borrow::Borrow`], and [`std::borrow::Cow`].
187 /// 187 ///
188 /// This is used, for example, by [`crate::mapping::Mapping::apply`]. 188 /// This is used, for example, by [`crate::mapping::Mapping::apply`].
189 pub trait Instance<X, D = <X as Space>::Decomp>: Sized + Ownable 189 pub trait Instance<X, D = <X as Space>::Decomp>:
190 Sized + Ownable<OwnedVariant = X::OwnedSpace>
190 where 191 where
191 X: Space, 192 X: Space,
192 D: Decomposition<X>, 193 D: Decomposition<X>,
193 { 194 {
194 /// Decomposes self according to `decomposer`, and evaluate `f` on the result. 195 /// Decomposes self according to `decomposer`, and evaluate `f` on the result.

mercurial