github.com/grailbio/base@v0.0.11/mapio/scanner.go (about)

     1  // Copyright 2018 GRAIL, Inc. All rights reserved.
     2  // Use of this source code is governed by the Apache 2.0
     3  // license that can be found in the LICENSE file.
     4  
     5  package mapio
     6  
     7  // Scanner is an ordered iterator over map entries.
     8  type Scanner interface {
     9  	// Scan scans the next entry, returning true on success, after which
    10  	// time the entry is available to inspect using the Key and Value
    11  	// methods.
    12  	Scan() bool
    13  	// Err returns the last error encountered while scanning, if any.
    14  	Err() error
    15  	// Key returns the key of the last scanned entry.
    16  	Key() []byte
    17  	// Value returns the value of the last scanned entry.
    18  	Value() []byte
    19  }