Lines Matching refs:blob
203 blob: *mut ffi::sqlite3_blob, field
227 let mut blob = ptr::null_mut(); in blob_open() localVariable
239 &mut blob, in blob_open()
244 blob, in blob_open()
258 let rc = unsafe { ffi::sqlite3_blob_reopen(self.blob, row) }; in reopen()
270 unsafe { ffi::sqlite3_blob_bytes(self.blob) } in size()
304 let rc = unsafe { ffi::sqlite3_blob_close(self.blob) }; in close_()
305 self.blob = ptr::null_mut(); in close_()
324 let rc = unsafe { ffi::sqlite3_blob_read(self.blob, buf.as_mut_ptr().cast(), n, self.pos) }; in read()
354 let rc = unsafe { ffi::sqlite3_blob_write(self.blob, buf.as_ptr() as *mut _, n, self.pos) }; in write()
442 let mut blob = db.blob_open(DatabaseName::Main, "test", "content", rowid, false)?; in test_blob() localVariable
443 assert_eq!(4, blob.write(b"Clob").unwrap()); in test_blob()
444 assert_eq!(6, blob.write(b"567890xxxxxx").unwrap()); // cannot write past 10 in test_blob()
445 assert_eq!(0, blob.write(b"5678").unwrap()); // still cannot write past 10 in test_blob()
447 blob.reopen(rowid)?; in test_blob()
448 blob.close()?; in test_blob()
450 blob = db.blob_open(DatabaseName::Main, "test", "content", rowid, true)?; in test_blob()
452 assert_eq!(5, blob.read(&mut bytes[..]).unwrap()); in test_blob()
454 assert_eq!(5, blob.read(&mut bytes[..]).unwrap()); in test_blob()
456 assert_eq!(0, blob.read(&mut bytes[..]).unwrap()); in test_blob()
458 blob.seek(SeekFrom::Start(2)).unwrap(); in test_blob()
459 assert_eq!(5, blob.read(&mut bytes[..]).unwrap()); in test_blob()
463 blob.seek(SeekFrom::Current(-1)).unwrap(); in test_blob()
464 assert_eq!(4, blob.read(&mut bytes[..]).unwrap()); in test_blob()
467 blob.seek(SeekFrom::End(-6)).unwrap(); in test_blob()
468 assert_eq!(5, blob.read(&mut bytes[..]).unwrap()); in test_blob()
471 blob.reopen(rowid)?; in test_blob()
472 assert_eq!(5, blob.read(&mut bytes[..]).unwrap()); in test_blob()
476 assert!(blob.seek(SeekFrom::Current(-20)).is_err()); in test_blob()
477 assert!(blob.seek(SeekFrom::End(0)).is_ok()); in test_blob()
478 assert!(blob.seek(SeekFrom::Current(1)).is_err()); in test_blob()
482 blob.reopen(rowid)?; in test_blob()
483 assert!(blob.write_all(b"0123456789x").is_err()); in test_blob()
491 let mut blob = db.blob_open(DatabaseName::Main, "test", "content", rowid, false)?; in test_blob_in_bufreader() localVariable
492 assert_eq!(8, blob.write(b"one\ntwo\n").unwrap()); in test_blob_in_bufreader()
494 blob.reopen(rowid)?; in test_blob_in_bufreader()
495 let mut reader = BufReader::new(blob); in test_blob_in_bufreader()
516 let blob = db.blob_open(DatabaseName::Main, "test", "content", rowid, false)?; in test_blob_in_bufwriter() localVariable
517 let mut writer = BufWriter::new(blob); in test_blob_in_bufwriter()
527 let mut blob = db.blob_open(DatabaseName::Main, "test", "content", rowid, false)?; in test_blob_in_bufwriter() localVariable
529 assert_eq!(10, blob.read(&mut bytes[..]).unwrap()); in test_blob_in_bufwriter()
534 let blob = db.blob_open(DatabaseName::Main, "test", "content", rowid, false)?; in test_blob_in_bufwriter() localVariable
535 let mut writer = BufWriter::new(blob); in test_blob_in_bufwriter()
544 let mut blob = db.blob_open(DatabaseName::Main, "test", "content", rowid, false)?; in test_blob_in_bufwriter() localVariable
546 assert_eq!(10, blob.read(&mut bytes[..]).unwrap()); in test_blob_in_bufwriter()