github.com/ladydascalie/elvish@v0.0.0-20170703214355-2964dd3ece7f/edit/tty/read_unit.go (about)

     1  package tty
     2  
     3  import "github.com/elves/elvish/edit/ui"
     4  
     5  // ReadUnit represents one "thing" that the Reader has read. It is one of the
     6  // following: RawRune (when the reader is in the raw mode), Key, CursorPosition,
     7  // MouseEvent, or PasteSetting.
     8  type ReadUnit interface {
     9  	isReadUnit()
    10  }
    11  
    12  type RawRune rune
    13  type Key ui.Key
    14  type CursorPosition Pos
    15  type PasteSetting bool
    16  
    17  func (RawRune) isReadUnit()        {}
    18  func (Key) isReadUnit()            {}
    19  func (CursorPosition) isReadUnit() {}
    20  func (MouseEvent) isReadUnit()     {}
    21  func (PasteSetting) isReadUnit()   {}