src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

trait.go (742B)


      1 package smithy
      2 
      3 // Trait represents a trait applied to a shape in a Smithy model. Traits
      4 // related to (de)serialization are included in code-generated Schemas for the
      5 // client.
      6 type Trait interface {
      7 	TraitID() ShapeID
      8 }
      9 
     10 // IndexableTrait is optionally implemented by Trait values that have a
     11 // reserved index in Schema's indexed trait slice. All traits defined in the
     12 // traits package implement this interface.
     13 //
     14 // You SHOULD NOT implement this outside of a smithy-go trait unless you know
     15 // what you are doing. If you implement this and return a value that collides
     16 // with one of the primary serde-based indexed traits (see index.go) you will
     17 // probably break something.
     18 type IndexableTrait interface {
     19 	Trait
     20 	TraitIndex() int
     21 }