[−][src]Struct latex::Document
The root Document node.
Fields
class: DocumentClass
The document class.
preamble: Preamble
The Document
's preamble.
Methods
impl Document
[src]
pub fn new(document_class: DocumentClass) -> Self
[src]
Create a new Document
with the specified DocumentClass
.
pub fn push<E>(&mut self, element: E) -> &mut Self where
E: Into<Element>,
[src]
E: Into<Element>,
Add an element to the Document
.
To make this work as seamlessly as possible, it will accept anything
which can be converted into an Element
using into()
and supports
the builder pattern with method chaining.
pub fn iter(&self) -> Iter<Element>
[src]
Iterate over the Elements in this document.
pub fn push_doc(&mut self, doc: &Document) -> &mut Self
[src]
A convience method to include one document into another by cloning the individual nodes.
Methods from Deref<Target = Vec<Element>>
pub fn capacity(&self) -> usize
1.0.0[src]
Returns the number of elements the vector can hold without reallocating.
Examples
let vec: Vec<i32> = Vec::with_capacity(10); assert_eq!(vec.capacity(), 10);
pub fn as_slice(&self) -> &[T]
1.7.0[src]
Extracts a slice containing the entire vector.
Equivalent to &s[..]
.
Examples
use std::io::{self, Write}; let buffer = vec![1, 2, 3, 5, 8]; io::sink().write(buffer.as_slice()).unwrap();
pub fn len(&self) -> usize
1.0.0[src]
Returns the number of elements in the vector, also referred to as its 'length'.
Examples
let a = vec![1, 2, 3]; assert_eq!(a.len(), 3);
pub fn is_empty(&self) -> bool
1.0.0[src]
Returns true
if the vector contains no elements.
Examples
let mut v = Vec::new(); assert!(v.is_empty()); v.push(1); assert!(!v.is_empty());
Trait Implementations
impl Default for Document
[src]
impl Clone for Document
[src]
fn clone(&self) -> Document
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Extend<Element> for Document
[src]
fn extend<T: IntoIterator<Item = Element>>(&mut self, iter: T)
[src]
impl PartialEq<Document> for Document
[src]
impl Deref for Document
[src]
type Target = Vec<Element>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
A shortcut to let you iterate over the elements in the Document
.
impl Debug for Document
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,