Skip to content

Implement ParamSerializer::serialize_bytes() #356

@abonander

Description

@abonander

It could be useful to be able to bind a binary string as a parameter, but ParamSerializer::serialize_bytes() is currently stubbed out:

unsupported!(
serialize_map(Option<usize>) -> Result<Impossible>,
serialize_bytes(&[u8]),
serialize_unit,
serialize_unit_struct(&'static str),
);

I don't really understand why it's not supported, as I assume we could use the same hex escape format as we do for client-side binding:

fn serialize_bytes(self, value: &[u8]) -> Result {
escape::hex_bytes(value, self.writer)?;
Ok(())
}

It may not be that efficient, but that doesn't seem to be a good reason not to support it at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions