1 /* 2 * Hunt - A redis client library for D programming language. 3 * 4 * Copyright (C) 2018-2019 HuntLabs 5 * 6 * Website: https://www.huntlabs.net/ 7 * 8 * Licensed under the Apache-2.0 License. 9 * 10 */ 11 12 module hunt.redis.ScanResult; 13 14 import hunt.redis.ScanParams; 15 16 import hunt.collection.List; 17 18 19 class ScanResult(T) { 20 private string cursor; 21 private List!(T) results; 22 23 this(string cursor, List!(T) results) { 24 this.cursor = cursor; 25 this.results = results; 26 } 27 28 /** 29 * Returns the new value of the cursor 30 * @return the new cursor value. {@link ScanParams#SCAN_POINTER_START} when a complete iteration has finished 31 */ 32 string getCursor() { 33 return cursor; 34 } 35 36 /** 37 * Is the iteration complete. I.e. was the complete dataset scanned. 38 * 39 * @return true if the iteration is complete 40 */ 41 bool isCompleteIteration() { 42 return ScanParams.SCAN_POINTER_START == getCursor(); 43 } 44 45 string getCursorAsBytes() { 46 return cursor; 47 } 48 49 /** 50 * The scan results from the current call. 51 * @return the scan results 52 */ 53 List!(T) getResult() { 54 return results; 55 } 56 }