[][src]Struct cortex::models::Corpus

pub struct Corpus {
    pub id: i32,
    pub path: String,
    pub name: String,
    pub complex: bool,
    pub description: String,
}

A minimal description of a document collection. Defined by a name, path and simple/complex file system setup.

Fields

id: i32

auto-incremented postgres id

path: String

file system path to corpus root (a corpus is held in a single top-level directory)

name: String

a human-readable name for this corpus

complex: bool

are we using multiple files to represent a document entry? (if unsure, always use "true")

description: String

a human-readable description of the corpus, maybe allow markdown here?

Implementations

impl Corpus[src]

pub fn find_by_name(
    name_query: &str,
    connection: &PgConnection
) -> Result<Self, Error>
[src]

ORM-like until diesel.rs introduces finders for more fields

pub fn find_by_path(
    path_query: &str,
    connection: &PgConnection
) -> Result<Self, Error>
[src]

ORM-like until diesel.rs introduces finders for more fields

pub fn to_hash(&self) -> HashMap<String, String>[src]

Return a hash representation of the corpus, usually for frontend reports

pub fn select_services(
    &self,
    connection: &PgConnection
) -> Result<Vec<Service>, Error>
[src]

Return a vector of services currently activated on this corpus

pub fn destroy(self, connection: &PgConnection) -> Result<usize, Error>[src]

Deletes a corpus and its dependent tasks from the DB, consuming the object

Trait Implementations

impl<'update> AsChangeset for &'update Corpus[src]

type Target = table

The table which Self::Changeset will be updating

type Changeset = <(Eq<path, &'update String>, Eq<name, &'update String>, Eq<complex, &'update bool>, Eq<description, &'update String>) as AsChangeset>::Changeset

The update statement this type represents

impl<'update> AsChangeset for Corpus[src]

type Target = table

The table which Self::Changeset will be updating

type Changeset = <(Eq<path, String>, Eq<name, String>, Eq<complex, bool>, Eq<description, String>) as AsChangeset>::Changeset

The update statement this type represents

impl Clone for Corpus[src]

impl Debug for Corpus[src]

impl HasTable for Corpus[src]

type Table = table

The table this type is associated with.

impl<'ident> Identifiable for &'ident Corpus[src]

type Id = &'ident i32

The type of this struct's identifier. Read more

impl<__DB: Backend, __ST> Queryable<__ST, __DB> for Corpus where
    (i32, String, String, bool, String): Queryable<__ST, __DB>, 
[src]

type Row = <(i32, String, String, bool, String) as Queryable<__ST, __DB>>::Row

The Rust type you'd like to map from. Read more

impl Serialize for Corpus[src]

Auto Trait Implementations

impl RefUnwindSafe for Corpus

impl Send for Corpus

impl Sync for Corpus

impl Unpin for Corpus

impl UnwindSafe for Corpus

Blanket Implementations

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

impl<T, I> AsResult<T, I> for T where
    I: Input, 

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

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

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

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

impl<T> IntoCollection<T> for T

impl<T> IntoSql for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

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> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,