indent_display/traits.rs
1/*a Copyright
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14
15@file traits.rs
16@brief Basic traits for the indenter
17 */
18
19//a Imports
20use crate::Indenter;
21
22//a Traits
23//tt IndentedOptions
24pub trait IndentedOptions<'a>: Sized + 'a {}
25
26//tt IndentedDisplay
27pub trait IndentedDisplay<'a, Opt: IndentedOptions<'a>> {
28 //mp fmt
29 /// Display for humans with indent
30 fn indent(&self, f: &mut Indenter<'a, Opt>) -> std::fmt::Result;
31}
32
33//tt DefaultIndentedDisplay
34pub trait DefaultIndentedDisplay: std::fmt::Display {}