pub struct Relation {Show 18 fields
pub id: String,
pub key: String,
pub format: i32,
pub name: String,
pub default_value: Option<Value>,
pub data_source: i32,
pub hidden: bool,
pub read_only: bool,
pub read_only_relation: bool,
pub multi: bool,
pub object_types: Vec<String>,
pub select_dict: Vec<Option>,
pub max_count: i32,
pub description: String,
pub scope: i32,
pub creator: String,
pub revision: i64,
pub include_time: bool,
}Expand description
Relation describe the human-interpreted relation type. It may be something like “Date of creation, format=date” or “Assignee, format=objectId, objectType=person”
Fields§
§id: String§key: StringKey under which the value is stored in the map. Must be unique for the object type. It usually auto-generated bsonid, but also may be something human-readable in case of prebuilt types.
format: i32format of the underlying data
name: Stringname to show (can be localized for bundled types)
default_value: Option<Value>§data_source: i32where the data is stored
internal, not displayed to user (e.g. coverX, coverY)
read_only: boolvalue not editable by user tobe renamed to readonlyValue
read_only_relation: boolrelation metadata, eg name and format is not editable by user
multi: boolallow multiple values (stored in pb list)
object_types: Vec<String>URL of object type, empty to allow link to any object
select_dict: Vec<Option>index 10, 11 was used in internal-only builds. Can be reused, but may break some test accounts
default dictionary with unique values to choose for select/multiSelect format
max_count: i32max number of values can be set for this relation. 0 means no limit. 1 means the value can be stored in non-repeated field
description: String§scope: i32on-store fields, injected only locally
deprecated, to be removed
creator: Stringcreator profile id
revision: i64revision of system relation. Used to check if we should change relation content or not
include_time: boolindicates whether value of relation with date format should be processed with seconds precision
Implementations§
Source§impl Relation
impl Relation
Sourcepub fn format(&self) -> RelationFormat
pub fn format(&self) -> RelationFormat
Returns the enum value of format, or the default if the field is set to an invalid enum value.
Sourcepub fn set_format(&mut self, value: RelationFormat)
pub fn set_format(&mut self, value: RelationFormat)
Sets format to the provided enum value.
Sourcepub fn data_source(&self) -> DataSource
pub fn data_source(&self) -> DataSource
Returns the enum value of data_source, or the default if the field is set to an invalid enum value.
Sourcepub fn set_data_source(&mut self, value: DataSource)
pub fn set_data_source(&mut self, value: DataSource)
Sets data_source to the provided enum value.
Trait Implementations§
Source§impl Message for Relation
impl Message for Relation
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.impl StructuralPartialEq for Relation
Auto Trait Implementations§
impl Freeze for Relation
impl RefUnwindSafe for Relation
impl Send for Relation
impl Sync for Relation
impl Unpin for Relation
impl UnsafeUnpin for Relation
impl UnwindSafe for Relation
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request