Struct bitcoin_compressor::ScriptCompression
source · pub struct ScriptCompression {}
Expand description
| Compact serializer for scripts. | | It detects common cases and encodes | them much more efficiently. 3 special | cases are defined: | | - Pay to pubkey hash (encoded as 21 bytes) | | - Pay to script hash (encoded as 21 bytes) | | - Pay to pubkey starting with 0x02, 0x03 | or 0x04 (encoded as 33 bytes) | | Other scripts up to 121 bytes require | 1 byte + script length. Above that, scripts | up to 16505 bytes require 2 bytes + script | length. |
Implementations§
source§impl ScriptCompression
impl ScriptCompression
pub fn ser<Stream: Write + VarIntWriter>( &mut self, stream: &mut Stream, script: &Script )
pub fn unser<Stream: Read + VarIntReader>( &mut self, stream: &mut Stream, script: &mut Script )
Auto Trait Implementations§
impl RefUnwindSafe for ScriptCompression
impl Send for ScriptCompression
impl Sync for ScriptCompression
impl Unpin for ScriptCompression
impl UnwindSafe for ScriptCompression
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> StaticUpcast<T> for T
impl<T> StaticUpcast<T> for T
§unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
Convert type of a const pointer. Read more