Struct secret_cosmwasm_std::Binary
source · [−]Expand description
Binary is a wrapper around Vec
This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec
Tuple Fields
0: Vec<u8>
Implementations
sourceimpl Binary
impl Binary
sourcepub fn from_base64(encoded: &str) -> StdResult<Self>
pub fn from_base64(encoded: &str) -> StdResult<Self>
take an (untrusted) string and decode it into bytes. fails if it is not valid base64
sourcepub fn to_base64(&self) -> String
pub fn to_base64(&self) -> String
encode to base64 string (guaranteed to be success as we control the data inside). this returns normalized form (with trailing = if needed)
pub fn as_slice(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Binary
impl<'de> Deserialize<'de> for Binary
Deserializes as a base64 string
sourcefn deserialize<D>(deserializer: D) -> Result<Binary, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Binary, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl JsonSchema for Binary
impl JsonSchema for Binary
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourcefn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the $ref
keyword. Read more
impl StructuralPartialEq for Binary
Auto Trait Implementations
impl RefUnwindSafe for Binary
impl Send for Binary
impl Sync for Binary
impl Unpin for Binary
impl UnwindSafe for Binary
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more