pub struct RpcParam {
pub name: String,
pub flags: ParamFlags,
pub type_info: TypeInfo,
pub value: Option<Bytes>,
}Expand description
An RPC parameter.
Fields§
§name: StringParameter name (can be empty for positional params).
flags: ParamFlagsStatus flags.
type_info: TypeInfoType information.
value: Option<Bytes>Parameter value (raw bytes).
Implementations§
Source§impl RpcParam
impl RpcParam
Sourcepub fn new(name: impl Into<String>, type_info: TypeInfo, value: Bytes) -> Self
pub fn new(name: impl Into<String>, type_info: TypeInfo, value: Bytes) -> Self
Create a new parameter with a value.
Sourcepub fn varchar(name: impl Into<String>, value: &str) -> Self
pub fn varchar(name: impl Into<String>, value: &str) -> Self
Create a VARCHAR parameter.
Encodes the string as single-byte characters using Windows-1252 encoding
(when the encoding feature is enabled) or Latin-1 fallback. Characters
not representable in the target encoding are replaced with ?.
Use this instead of nvarchar when
SendStringParametersAsUnicode=false to allow SQL Server to use
index seeks on VARCHAR columns.
Sourcepub fn varchar_with_collation(
name: impl Into<String>,
value: &str,
collation: &Collation,
) -> Self
pub fn varchar_with_collation( name: impl Into<String>, value: &str, collation: &Collation, ) -> Self
Create a VARCHAR parameter using the server’s collation for encoding.
Uses the collation’s character encoding instead of the default Windows-1252. For UTF-8 collations (SQL Server 2019+), the string bytes are used directly.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RpcParam
impl RefUnwindSafe for RpcParam
impl Send for RpcParam
impl Sync for RpcParam
impl Unpin for RpcParam
impl UnsafeUnpin for RpcParam
impl UnwindSafe for RpcParam
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more