pub fn from_string<S: Into<String>>(s: S) -> Self {
        let buf: String = s.into();
        let mut vec: Vec<_> = buf.split("#").collect();

        // If after the split we only have one element, there was no
        // `#` separator, so the type needs to be implicitly `= 0`
        let (tt, inner) = if vec.len() == 1 {
            (0, vec.remove(0).as_bytes().to_vec())
        }
        // If after the split we have 2 elements, we extract the type
        // value from the string, and use the rest as the address
        else if vec.len() == 2 {
            let tt = match str::parse(vec.remove(0)) {
                Ok(tt) => tt,
                Err(e) => {
                    panic!("Failed to parse address type: '{}'", e);
                }
            };

            (tt, vec.remove(0).as_bytes().to_vec())
        } else {
            panic!("Invalid address string: more than one `#` separator found");
        };

        Self { tt, inner }
    }
/// Parse an address from a string
///
/// See type documentation for more detail
Parse an address from a string
See type documentation for more detail
Parse an address from a string See type documentation for more detail
pub fn from_string<S: Into<String>>(s: S) -> Self {
        let buf: String = s.into();
        let mut vec: Vec<_> = buf.split("#").collect();
        // If after the split we only have one element, there was no
        // `#` separator, so the type needs to be implicitly `= 0`
        let (tt, inner) = if vec.len() == 1 {
            (0, vec.remove(0).as_bytes().to_vec())
        }
        // If after the split we have 2 elements, we extract the type
        // value from the string, and use the rest as the address
        else if vec.len() == 2 {
            let tt = match str::parse(vec.remove(0)) {
                Ok(tt) => tt,
                Err(e) => {
                    panic!("Failed to parse address type: '{}'", e);
                }
            };
            (tt, vec.remove(0).as_bytes().to_vec())
        } else {
            panic!("Invalid address string: more than one `#` separator found");
        };
        Self { tt, inner }
    }
pub fn from_string < S : Into < String > > ( s : S ) -> Self { let buf : String = s . into ( ) ; let mut vec : Vec < _ > = buf . split ( " " ) . collect ( ) ; // If after the split we only have one element, there was no // `#` separator, so the type needs to be implicitly `= 0` let ( tt , inner ) = if vec . len ( ) == 1 { ( 0 , vec . remove ( 0 ) . as_bytes ( ) . to_vec ( ) ) } // If after the split we have 2 elements, we extract the type // value from the string, and use the rest as the address else if vec . len ( ) == 2 { let tt = match str :: parse ( vec . remove ( 0 ) ) { Ok ( tt ) => tt , Err ( e ) => { panic ! ( " " e ) ; } } ; ( tt , vec . remove ( 0 ) . as_bytes ( ) . to_vec ( ) ) } else { panic ! ( " " ) ; } ; Self { tt , inner } }
Parse an address from a string
See type documentation for more detail
Parse an address from a string See type documentation for more detail
s
S