1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#[ allow( clippy ::std_instead_of_alloc, clippy ::std_instead_of_core ) ]
mod private
{
use crate :: *;
use std ::
{
borrow ::Cow,
};
/// A trait for converting an object to its code representation.
///
/// The `AsCode` trait defines a method for converting an object into a code representation,
/// typically as a string. This can be useful for generating code from various data structures
/// or objects.
///
pub trait AsCode
{
/// Converts the object to its code representation.
/// # Errors
/// qqq: doc
fn as_code( &self ) -> std ::io ::Result< Cow< '_, str > >;
}
/// A trait for retrieving an iterator over items of a source file.
///
/// The `CodeItems` trait is used to represent objects that can provide an iterator over their
/// contained source files. This is useful in scenarios where you need to access or process
/// all source files associated with an object, such as a workspace or a package.
pub trait CodeItems
{
/// Returns an iterator over the source files.
fn items( &self ) -> impl IterTrait< '_, syn ::Item >;
}
}
//
crate ::mod_interface!
{
exposed use AsCode;
exposed use CodeItems;
}