[−][src]Struct g1::Connection
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]
&'_ self,
atom: Atom,
ns: &'_ str,
title: &'_ str
) -> Result<(), QueryError>
Creates a new name for an Atom
.
pub async fn delete_name<'_, '_, '_>(
&'_ self,
ns: &'_ str,
title: &'_ str
) -> Result<bool, QueryError>
[src]
&'_ self,
ns: &'_ str,
title: &'_ str
) -> Result<bool, QueryError>
Deletes a name, returning whether it existed.
pub async fn find_atom_by_name<'_, '_, '_>(
&'_ self,
ns: &'_ str,
title: &'_ str
) -> Result<Option<Atom>, QueryError>
[src]
&'_ self,
ns: &'_ str,
title: &'_ str
) -> Result<Option<Atom>, QueryError>
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]
&'_ self,
from: Atom,
to: Atom,
key: &'_ str
) -> Result<(), QueryError>
Creates an edge between two Atom
s.
pub async fn delete_edge<'_, '_>(
&'_ self,
from: Atom,
to: Atom,
key: &'_ str
) -> Result<bool, QueryError>
[src]
&'_ self,
from: Atom,
to: Atom,
key: &'_ str
) -> Result<bool, QueryError>
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]
&'_ self,
from: Option<Atom>,
to: Option<Atom>,
key: Option<&'_ str>
) -> Result<Vec<(Atom, Atom, String)>, QueryError>
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]
&'_ self,
atom: Atom,
kind: &'_ str,
value: &'_ str
) -> Result<(), QueryError>
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]
&'_ self,
atom: Atom,
kind: &'_ str
) -> Result<Option<String>, QueryError>
Find the tag with the given kind on the Atom
.
pub async fn delete_tag<'_, '_>(
&'_ self,
atom: Atom,
kind: &'_ str
) -> Result<bool, QueryError>
[src]
&'_ self,
atom: Atom,
kind: &'_ str
) -> Result<bool, QueryError>
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]
&'_ self,
atom: Atom,
mime: Mime,
contents: &'_ [u8]
) -> Result<(), QueryError>
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]
&'_ self,
atom: Atom,
mime: Mime
) -> Result<bool, QueryError>
Deletes the blob with the given MIME type on the Atom
, returning whether it was found.
Trait Implementations
Auto Trait Implementations
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
impl !RefUnwindSafe for Connection
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,