Struct otter_api_tests::shapelib::GroupDefn[][src]

pub struct GroupDefn {
    pub files: FileList,
    pub item_prefix: String,
    pub item_suffix: String,
    pub sort: String,
    // some fields omitted
}

Details for a group of pieces. See also GroupDetails.

This is separate from GroupDetails only to make the implementation convenient (for complicated reasons). At the library TOML file level, there is no meaningful difference between the fields in this struct, and the ones in GroupDetails

Fields

files: FileList

files is a multi-line string, each line of which has (normally) three fields (the leading ones terminated by whitespace). The fields are those in FileData. # comments are supported.

Each non-empty non-comment line in files specifies a single SVG to be made aavailable as a piece.

The piece has am item name which is used within Otter to refer to the piece (for example, with otter library-add). The SVG filename is derived from the item name, as follows: library/lib/itemname.svg.

The itemname is the item_spec from each entry in files (see FileData sandwiched between item_prefix and item_suffix

Item names are conventionally structured using a hierarchical name with - between the components. Do not put / or _ in item names.

It is also possible to specify additional data for each item by adding fields to each line. This is done by adding a line at the start starting with : and then additing one additional whitespace separated value on each data line. Unknown fieldname values are ignored. Currently the extra fields supported are:

  • sort: Specifies the sort key. See the sort group definition property.

The values for these extra fields come just before the dwscription, after the other whitespace-delimited fields, in the same order as specified in the : heading line.

item_prefix: String

See the discussioin of the item name. These two fields default to "".

item_suffix: Stringsort: String

The sort key (used for item sorting in hands).

If neither the group property, nor the files extra field, are specified, the item name is used.

If both are specified, the group property is used as a template. _s is replaced by the sort extra field from the files list _c is replaced by the colour, if applicable.

Trait Implementations

impl Debug for GroupDefn[src]

impl<'de> Deserialize<'de> for GroupDefn[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<A> DynCastExt for A

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

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>,