var ErrNilValue = errors.New("value is nil")
func MarshalValue(val interface{}, encFn EncoderFn) (bsoncore.Value, error)
MarshalValue will attempt to encode the value with the encoder returned by the encoder function.
EncoderFn is used to functionally construct an encoder for marshaling values.
type EncoderFn func(io.Writer) (*bson.Encoder, error)
MarshalError is returned when attempting to transform a value into a document results in an error.
type MarshalError struct { Value interface{} Err error }
func (e MarshalError) Error() string
Error implements the error interface.