Struct Org

Source
pub struct Org<'a> { /* private fields */ }

Implementations§

Source§

impl Org<'_>

Source

pub fn document(&self) -> Document

Returns the Document.

Source

pub fn headlines(&self) -> impl Iterator<Item = Headline> + '_

Returns an iterator of Headlines.

Source§

impl<'a> Org<'a>

Source

pub fn new() -> Org<'static>

Creates a new empty Org struct.

Source

pub fn parse(text: &'a str) -> Org<'a>

Parses string text into Org struct.

Source

pub fn parse_string(text: String) -> Org<'static>

Likes parse, but accepts String.

Source

pub fn parse_custom(text: &'a str, config: &ParseConfig) -> Org<'a>

Parses string text into Org struct with custom ParseConfig.

Source

pub fn parse_string_custom(text: String, config: &ParseConfig) -> Org<'static>

Likes parse_custom, but accepts String.

Source

pub fn arena(&self) -> &Arena<Element<'a>>

Returns a reference to the underlay arena.

Source

pub fn arena_mut(&mut self) -> &mut Arena<Element<'a>>

Returns a mutual reference to the underlay arena.

Source

pub fn iter<'b>(&'b self) -> impl Iterator<Item = Event<'a, 'b>> + 'b

Returns an iterator of Events.

Source

pub fn keywords(&self) -> impl Iterator<Item = &Keyword<'_>>

Returns an iterator of Keywords.

Source

pub fn write_html<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Writes an Org struct as html format.

Source

pub fn write_html_custom<W, H, E>( &self, writer: W, handler: &mut H, ) -> Result<(), E>
where W: Write, E: From<Error>, H: HtmlHandler<E>,

Writes an Org struct as html format with custom HtmlHandler.

Source

pub fn write_org<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Writes an Org struct as org format.

Source

pub fn write_org_custom<W, H, E>( &self, writer: W, handler: &mut H, ) -> Result<(), E>
where W: Write, E: From<Error>, H: OrgHandler<E>,

Writes an Org struct as org format with custom OrgHandler.

Source§

impl Org<'_>

Source

pub fn validate(&self) -> Vec<ValidationError>

Validates an Org struct.

Trait Implementations§

Source§

impl Default for Org<'static>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> Index<NodeId> for Org<'a>

Source§

type Output = Element<'a>

The returned type after indexing.
Source§

fn index(&self, node_id: NodeId) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a> IndexMut<NodeId> for Org<'a>

Source§

fn index_mut(&mut self, node_id: NodeId) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl Serialize for Org<'_>

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Org<'a>

§

impl<'a> RefUnwindSafe for Org<'a>

§

impl<'a> Send for Org<'a>

§

impl<'a> Sync for Org<'a>

§

impl<'a> Unpin for Org<'a>

§

impl<'a> UnwindSafe for Org<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.