mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-28 23:27:36 +00:00
d1a4e43c48
Further simplifies error handling.
12 lines
516 B
Go
12 lines
516 B
Go
package io
|
|
|
|
// Serializable defines the binary encoding/decoding interface. Errors are
|
|
// returned via BinReader/BinWriter Err field. These functions must have safe
|
|
// behavior when passed BinReader/BinWriter with Err already set. Invocations
|
|
// to these functions tend to be nested, with this mechanism only the top-level
|
|
// caller should handle the error once and all the other code should just not
|
|
// panic in presence of error.
|
|
type Serializable interface {
|
|
DecodeBinary(*BinReader)
|
|
EncodeBinary(*BinWriter)
|
|
}
|