mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-26 19:41:37 +08:00
Reduce visibility of unsafe methods
This commit is contained in:
parent
b8594a0f83
commit
9a96e3a494
@ -15,7 +15,7 @@ use types::{ToSqlOutput, ValueRef};
|
|||||||
use vtab::array::{free_array, ARRAY_TYPE};
|
use vtab::array::{free_array, ARRAY_TYPE};
|
||||||
|
|
||||||
impl<'a> ValueRef<'a> {
|
impl<'a> ValueRef<'a> {
|
||||||
pub unsafe fn from_value(value: *mut sqlite3_value) -> ValueRef<'a> {
|
pub(crate) unsafe fn from_value(value: *mut sqlite3_value) -> ValueRef<'a> {
|
||||||
use std::slice::from_raw_parts;
|
use std::slice::from_raw_parts;
|
||||||
|
|
||||||
match ffi::sqlite3_value_type(value) {
|
match ffi::sqlite3_value_type(value) {
|
||||||
@ -63,7 +63,7 @@ impl<'a> ValueRef<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn set_result<'a>(ctx: *mut sqlite3_context, result: &ToSqlOutput<'a>) {
|
pub(crate) unsafe fn set_result<'a>(ctx: *mut sqlite3_context, result: &ToSqlOutput<'a>) {
|
||||||
let value = match *result {
|
let value = match *result {
|
||||||
ToSqlOutput::Borrowed(v) => v,
|
ToSqlOutput::Borrowed(v) => v,
|
||||||
ToSqlOutput::Owned(ref v) => ValueRef::from(v),
|
ToSqlOutput::Owned(ref v) => ValueRef::from(v),
|
||||||
|
@ -727,7 +727,7 @@ pub unsafe fn cursor_error<T>(cursor: *mut ffi::sqlite3_vtab_cursor, result: Res
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Virtual tables methods can set an error message by assigning a string to `zErrMsg`.
|
/// Virtual tables methods can set an error message by assigning a string to `zErrMsg`.
|
||||||
pub unsafe fn set_err_msg(vtab: *mut ffi::sqlite3_vtab, err_msg: &str) {
|
unsafe fn set_err_msg(vtab: *mut ffi::sqlite3_vtab, err_msg: &str) {
|
||||||
if !(*vtab).zErrMsg.is_null() {
|
if !(*vtab).zErrMsg.is_null() {
|
||||||
ffi::sqlite3_free((*vtab).zErrMsg as *mut c_void);
|
ffi::sqlite3_free((*vtab).zErrMsg as *mut c_void);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user