Struct ::exo::Record

Overview

A record represents a single data object witin Exolynk

It's unique by his uuid and combined ident & version.

A record can only be accessed when the user fullfills the following criteria:

  • Has the correct base access right
  • Is at least part in one of the same station

When the user has access to the record, he can view all base attributes. Base Attributes are:

  • uuid
  • ident
  • version
  • model
  • released
  • access_rights
  • stations

The values attribute is further filtered down by the corresponding access variables of the related model.

Following variables have a fixed value typ:

  • name -> Language
  • description -> Language
  • status -> Selection
  • icon -> Icon
  • highlight_color -> Color
  • calendar_start -> DateTime
  • calendar_end -> DateTime
  • children -> Table

Methods

fn set_value(self, ident: String, value) -> Result

Set a value of this record.

fn get_value(self, ident: String) -> Option

Get a value of this record.

Example

let record = exo::get_record()?;
let value = record.get_value("name")?;
assert!(value is exo::Language);
fn get_variable(self, model: Model, ident: String) -> Option

Get a variable of this record and model.

Example

let model = exo::get_model()?;
let record = exo::get_record()?;
let variable = record.get_variable(model, "name")?;
assert!(variable is exo::Variable);

Protocols

protocol get ident
let output = value.ident

Allows a get operation to work.

protocol set ident
value.ident = input

Allows a set operation to work.

protocol get version
let output = value.version

Allows a get operation to work.

protocol set version
value.version = input

Allows a set operation to work.

protocol get released
let output = value.released

Allows a get operation to work.

protocol set released
value.released = input

Allows a set operation to work.

protocol get access_rights
let output = value.access_rights

Allows a get operation to work.

protocol set access_rights
value.access_rights = input

Allows a set operation to work.

protocol partial_eq
if value == b { }

Test two Records for partial equality.

Examples

use std::ops::partial_eq;

let record = exo::get_record()?;
let other = exo::get_record()?;
assert_eq!(partial_eq(record, other), true);

other.ident = exo::Ident::new("Other");
assert_ne!(record, other);
protocol string_debug
println("{:?}", value)

Allows the value to be debug printed.

protocol string_display
println("{}", value)

Allows the value to be display printed.

protocol get uuid
let output = value.uuid

Allows a get operation to work.

protocol set uuid
value.uuid = input

Allows a set operation to work.

protocol get model
let output = value.model

Allows a get operation to work.

protocol get name
Deprecated:Use the function record.get_value() instead
let output = value.name

Allows a get operation to work.

protocol set name
Deprecated:Use the function record.set_value() instead
value.name = input

Allows a set operation to work.

protocol get description
Deprecated:Use the function record.get_value() instead
let output = value.description

Allows a get operation to work.

protocol set description
Deprecated:Use the function record.set_value() instead
value.description = input

Allows a set operation to work.

protocol get status
Deprecated:Use the function record.get_value() instead
let output = value.status

Allows a get operation to work.

protocol set status
Deprecated:Use the function record.set_value() instead
value.status = input

Allows a set operation to work.

protocol get icon
Deprecated:Use the function record.get_value() instead
let output = value.icon

Allows a get operation to work.

protocol set icon
Deprecated:Use the function record.set_value() instead
value.icon = input

Allows a set operation to work.

protocol get highlight_color
Deprecated:Use the function record.get_value() instead
let output = value.highlight_color

Allows a get operation to work.

protocol set highlight_color
Deprecated:Use the function record.set_value() instead
value.highlight_color = input

Allows a set operation to work.

protocol get calendar_start
Deprecated:Use the function record.get_value() instead
let output = value.calendar_start

Allows a get operation to work.

protocol set calendar_start
Deprecated:Use the function record.set_value() instead
value.calendar_start = input

Allows a set operation to work.

protocol get calendar_end
Deprecated:Use the function record.get_value() instead
let output = value.calendar_end

Allows a get operation to work.

protocol set calendar_end
Deprecated:Use the function record.set_value() instead
value.calendar_end = input

Allows a set operation to work.

protocol get children
Deprecated:Use the function record.get_value() instead
let output = value.children

Allows a get operation to work.

protocol set children
Deprecated:Use the function record.set_value() instead
value.children = input

Allows a set operation to work.

protocol get access_right
Deprecated:Use the function record.get_value() instead
let output = value.access_right

Allows a get operation to work.

protocol set access_right
Deprecated:Use the function record.set_value() instead
value.access_right = input

Allows a set operation to work.