Skip to main content

GrpcObjectResults

type GrpcObjectResults​

The results of a batch of objects, in request order. Each item is either the object or the error the server reported for it.

Read items by position with `get`, or in order with `has_next` and `next`. An item's error does not end the iteration: `next` throws it and the following call moves on to the next item. Items can be read any number of times.

type GrpcObjectResults struct {
// contains filtered or unexported fields
}

func LiftFromExternalGrpcObjectResults​

func LiftFromExternalGrpcObjectResults(handle uint64) *GrpcObjectResults

func (*GrpcObjectResults) Destroy​

func (object *GrpcObjectResults) Destroy()

func (*GrpcObjectResults) Get​

func (_self *GrpcObjectResults) Get(index uint64) (GrpcObject, error)

The item at `index`, or an error carrying the message the server reported for it. Errors if `index` is out of range.

func (*GrpcObjectResults) HasNext​

func (_self *GrpcObjectResults) HasNext() bool

Whether `next` has an item left to return.

func (*GrpcObjectResults) IsEmpty​

func (_self *GrpcObjectResults) IsEmpty() bool

Whether there are no items.

func (*GrpcObjectResults) Len​

func (_self *GrpcObjectResults) Len() uint64

The number of items.

func (*GrpcObjectResults) Next​

func (_self *GrpcObjectResults) Next() (GrpcObject, error)

The next item, or an error carrying the message the server reported for it. Errors once every item has been returned.

`has_next` followed by `next` is not atomic: when several threads share the results, `next` can error as exhausted after `has_next` returned `true`.