pub struct GraphRepository { /* private fields */ }Implementations§
Source§impl GraphRepository
impl GraphRepository
pub fn new(pool: PgPool) -> Self
Sourcepub async fn insert(
&self,
conn: &mut PgConnection,
id: GraphId,
input: NewGraph,
) -> Result<GraphId, DomainError>
pub async fn insert( &self, conn: &mut PgConnection, id: GraphId, input: NewGraph, ) -> Result<GraphId, DomainError>
Create the sbol3-kind graph that backs a document. The caller mints
the GraphId so the document’s triples can be attributed to its
graph:document:{id} IRI before this write.
Sourcepub async fn exists_by_hash(&self, hash: &[u8]) -> Result<bool, DomainError>
pub async fn exists_by_hash(&self, hash: &[u8]) -> Result<bool, DomainError>
Returns true when any document graph already carries this content hash. Used by bulk import to dedup re-uploaded files without re-parsing.
pub async fn get(&self, id: GraphId) -> Result<Option<GraphRecord>, DomainError>
Sourcepub async fn list(
&self,
filter: &ListGraphsFilter,
) -> Result<Vec<GraphRecord>, DomainError>
pub async fn list( &self, filter: &ListGraphsFilter, ) -> Result<Vec<GraphRecord>, DomainError>
Paginated newest-first listing for the CLI / lab UI. Filters are optional and ANDed; cardinality is small so we don’t expose a keyset cursor here.
Sourcepub async fn delete(&self, id: GraphId) -> Result<bool, DomainError>
pub async fn delete(&self, id: GraphId) -> Result<bool, DomainError>
Delete one document by dropping its graph, which cascades to the graph’s
triples. (Derived-view objects have an ON DELETE SET NULL FK and survive;
cleaning them is the derived-view refresh’s job.) Returns true if a row
was removed.
Trait Implementations§
Source§impl Clone for GraphRepository
impl Clone for GraphRepository
Source§fn clone(&self) -> GraphRepository
fn clone(&self) -> GraphRepository
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for GraphRepository
impl !UnwindSafe for GraphRepository
impl Freeze for GraphRepository
impl Send for GraphRepository
impl Sync for GraphRepository
impl Unpin for GraphRepository
impl UnsafeUnpin for GraphRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more