surrealdb-sql 1.1.0

Full type definitions for the SurrealQL query language
Documentation
use crate::err::Error;
use crate::value::serde::ser;
use serde::ser::Impossible;

pub struct Serializer;

impl ser::Serializer for Serializer {
	type Ok = u16;
	type Error = Error;

	type SerializeSeq = Impossible<u16, Error>;
	type SerializeTuple = Impossible<u16, Error>;
	type SerializeTupleStruct = Impossible<u16, Error>;
	type SerializeTupleVariant = Impossible<u16, Error>;
	type SerializeMap = Impossible<u16, Error>;
	type SerializeStruct = Impossible<u16, Error>;
	type SerializeStructVariant = Impossible<u16, Error>;

	const EXPECTED: &'static str = "a u16";

	#[inline]
	fn serialize_u16(self, value: u16) -> Result<Self::Ok, Error> {
		Ok(value)
	}
}