pub struct SampleMetadata {
pub hash: Sha256Hash,
pub sample_name: String,
pub key: String,
pub value: MetadataValue,
}Expand description
One metadata value associated with a sample and key.
Fields§
§hash: Sha256HashContent hash including the sample, key, value type, and value.
sample_name: StringThe sample’s primary key in the samples table.
key: StringThe metadata key, unique within the sample.
value: MetadataValueExactly one typed metadata value.
Implementations§
Source§impl SampleMetadata
impl SampleMetadata
pub fn select(conn: &Connection) -> SampleMetadataSelect<'_>
pub fn all(conn: &Connection) -> Result<Vec<Self>, ModelSelectError>
Source§impl SampleMetadata
impl SampleMetadata
Sourcepub fn create(
conn: &GraphConnection,
sample_name: &str,
key: &str,
value: &MetadataValue,
) -> Result<Self, SampleMetadataError>
pub fn create( conn: &GraphConnection, sample_name: &str, key: &str, value: &MetadataValue, ) -> Result<Self, SampleMetadataError>
Store a new value; an existing key for this sample causes a uniqueness error.
Sourcepub fn upsert(
conn: &GraphConnection,
sample_name: &str,
key: &str,
value: &MetadataValue,
) -> Result<Self, SampleMetadataError>
pub fn upsert( conn: &GraphConnection, sample_name: &str, key: &str, value: &MetadataValue, ) -> Result<Self, SampleMetadataError>
Store a value, replacing the value and content hash for an existing sample key.
Trait Implementations§
Source§impl Clone for SampleMetadata
impl Clone for SampleMetadata
Source§impl Debug for SampleMetadata
impl Debug for SampleMetadata
Source§impl<'de> Deserialize<'de> for SampleMetadata
impl<'de> Deserialize<'de> for SampleMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SampleMetadata
impl PartialEq for SampleMetadata
Source§impl Serialize for SampleMetadata
impl Serialize for SampleMetadata
impl StructuralPartialEq for SampleMetadata
Auto Trait Implementations§
impl Freeze for SampleMetadata
impl RefUnwindSafe for SampleMetadata
impl Send for SampleMetadata
impl Sync for SampleMetadata
impl Unpin for SampleMetadata
impl UnsafeUnpin for SampleMetadata
impl UnwindSafe for SampleMetadata
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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