Struct yrs::YInput[][src]

#[repr(C)]
pub struct YInput { pub tag: c_char, pub len: c_int, // some fields omitted }
Expand description

A data structure that is used to pass input values of various types supported by Yrs into a shared document store.

YInput constructor function don’t allocate any resources on their own, neither they take ownership by pointers to memory blocks allocated by user - for this reason once an input cell has been used, its content should be freed by the caller.

Fields

tag: c_char

Tag describing, which value type is being stored by this input cell. Can be one of:

  • Y_JSON_BOOL for boolean flags.
  • Y_JSON_NUM for 64-bit floating point numbers.
  • Y_JSON_INT for 64-bit signed integers.
  • Y_JSON_STR for null-terminated UTF-8 encoded strings.
  • Y_JSON_BUF for embedded binary data.
  • Y_JSON_ARR for arrays of JSON-like values.
  • Y_JSON_MAP for JSON-like objects build from key-value pairs.
  • Y_JSON_NULL for JSON-like null values.
  • Y_JSON_UNDEF for JSON-like undefined values.
  • Y_ARRAY for cells which contents should be used to initialize a YArray shared type.
  • Y_MAP for cells which contents should be used to initialize a YMap shared type.
len: c_int

Length of the contents stored by current YInput cell.

For Y_JSON_NULL and Y_JSON_UNDEF its equal to 0.

For Y_JSON_ARR, Y_JSON_MAP, Y_ARRAY and Y_MAP it describes a number of passed elements.

For other types it’s always equal to 1.

Trait Implementations

Executes the destructor for this type. Read more

This method is used to create initial content required in order to create a block item. A supplied ptr can be used to identify block that is about to be created to store the returned content. Read more

Method called once an original item filled with content from Self::into_content has been added to block store. This method is used by complex types such as maps or arrays to append the original contents of prelim struct into YMap, YArray etc. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.