[][src]Struct g1::Connection

pub struct Connection { /* fields omitted */ }

A connection to a G1 database.

Methods

impl Connection[src]

pub fn open(base_url: &str) -> Result<Connection, OpenError>[src]

Opens a connection to the database at the given URL.

pub fn open_url(base_url: Url) -> Connection[src]

Opens a connection to the database at the given URL.

impl Connection[src]

pub async fn create_atom<'_>(&'_ self) -> Result<Atom, QueryError>[src]

Creates a new Atom.

pub async fn create_name<'_, '_, '_>(
    &'_ self,
    atom: Atom,
    ns: &'_ str,
    title: &'_ str
) -> Result<(), QueryError>
[src]

Creates a new name for an Atom.

pub async fn delete_name<'_, '_, '_>(
    &'_ self,
    ns: &'_ str,
    title: &'_ str
) -> Result<bool, QueryError>
[src]

Deletes a name, returning whether it existed.

pub async fn find_atom_by_name<'_, '_, '_>(
    &'_ self,
    ns: &'_ str,
    title: &'_ str
) -> Result<Option<Atom>, QueryError>
[src]

Finds the Atom corresponding to the given name, if any.

pub async fn create_edge<'_, '_>(
    &'_ self,
    from: Atom,
    to: Atom,
    key: &'_ str
) -> Result<(), QueryError>
[src]

Creates an edge between two Atoms.

pub async fn delete_edge<'_, '_>(
    &'_ self,
    from: Atom,
    to: Atom,
    key: &'_ str
) -> Result<bool, QueryError>
[src]

Deletes an edge, returning whether it existed.

pub async fn find_edges<'_, '_>(
    &'_ self,
    from: Option<Atom>,
    to: Option<Atom>,
    key: Option<&'_ str>
) -> Result<Vec<(Atom, Atom, String)>, QueryError>
[src]

Returns the edges that meet the given criteria as (from, to, key) tuples.

None means "don't care," the query is otherwise a conjunction (an AND).

pub async fn create_tag<'_, '_, '_>(
    &'_ self,
    atom: Atom,
    kind: &'_ str,
    value: &'_ str
) -> Result<(), QueryError>
[src]

Adds a tag to an Atom with the given kind and value.

pub async fn find_tag<'_, '_>(
    &'_ self,
    atom: Atom,
    kind: &'_ str
) -> Result<Option<String>, QueryError>
[src]

Find the tag with the given kind on the Atom.

pub async fn delete_tag<'_, '_>(
    &'_ self,
    atom: Atom,
    kind: &'_ str
) -> Result<bool, QueryError>
[src]

Deletes the tag with the given kind on the Atom, returning whether it was found.

pub async fn create_blob<'_, '_>(
    &'_ self,
    atom: Atom,
    mime: Mime,
    contents: &'_ [u8]
) -> Result<(), QueryError>
[src]

Adds a blob to an Atom with the given MIME type and value.

pub async fn delete_blob<'_>(
    &'_ self,
    atom: Atom,
    mime: Mime
) -> Result<bool, QueryError>
[src]

Deletes the blob with the given MIME type on the Atom, returning whether it was found.

Trait Implementations

impl Debug for Connection[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]