-
-
Notifications
You must be signed in to change notification settings - Fork 97
/
indices.rs
36 lines (30 loc) · 1.04 KB
/
indices.rs
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
//! These indices are for library internal use only. The trick is to publicly export
//! the types, but put the indices inside a private module. This way you can't
//! construct these types outside of the library. Use the `add_*` functions to get an index instead.
/// Index of the page (0-based)
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct PdfPageIndex(pub usize);
/// Index of the layer on the nth page
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct PdfLayerIndex(pub usize);
/// Index of the arbitrary content data
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct PdfContentIndex(pub usize);
/// Index of a font
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct FontIndex(pub PdfContentIndex);
impl Into<PdfContentIndex> for FontIndex {
fn into(self) -> PdfContentIndex
{
self.0
}
}
/// Index of a svg file
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct SvgIndex(pub PdfContentIndex);
impl Into<PdfContentIndex> for SvgIndex {
fn into(self) -> PdfContentIndex
{
self.0
}
}