private mdb_get ( |
||
txn | ||
dbi | uint | |
key | LightningDB.Native.ValueStructure | |
data | LightningDB.Native.ValueStructure | |
Résultat | int |
public static int mdb_get(IntPtr txn, uint dbi, byte[] key, out byte[] data) { using (var marshal = new MarshalValueStructure(key)) { ValueStructure value; var result = checkRead(LmdbMethods.mdb_get(txn, dbi, ref marshal.Key, out value)); if (result == MDB_NOTFOUND) { data = null; return(result); } data = value.GetBytes(); return(result); } }
public static unsafe int mdb_get(IntPtr txn, uint dbi, ReadOnlySpan <byte> key, out Span <byte> data) { fixed(byte *addKey = &key.GetPinnableReference()) { var keyVs = new ValueStructure { size = new IntPtr(key.Length), data = new IntPtr(addKey), }; ValueStructure value; var result = checkRead(LmdbMethods.mdb_get(txn, dbi, ref keyVs, out value)); if (result == MDB_NOTFOUND) { data = Span <byte> .Empty; return(result); } data = new Span <byte>(value.data.ToPointer(), value.size.ToInt32()); return(result); } }
public static MDBResultCode mdb_get(IntPtr txn, uint dbi, ref MDBValue key, out MDBValue value) { return(LmdbMethods.mdb_get(txn, dbi, ref key, out value)); }