# Trait VarSize

    pub trait VarSize {
        type Size: Scalar + Into<u32>;
    }

Expand description

A trait for types that have variable length.

As a rule, these types have an initial length field.

For types with a constant size, see `FixedSize` and for types which can pre-compute their size, see `ComputeSize`.

## Required Associated Types§

#### type Size: Scalar + Into<u32>

The type of the first (length) field of the item.

When reading this type, we will read this value first, and use it to determine the total length.

## Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

## Implementors§

§

### impl VarSize for SegmentMaps<'_>

§

#### type Size = u16

§

### impl VarSize for ScriptLangTag<'_>

§

#### type Size = u32

§

### impl VarSize for PString<'_>

§

#### type Size = u8