pub async fn sequence_create(
        &mut self,
        data: &[u8],
        name: Option<XorName>,
        type_tag: u64,
        private: bool,
    ) -> Result<XorUrl> {
        let xorname = self
            .safe_client
            .store_sequence(data, name, type_tag, None, private)
            .await?;

        SafeUrl::encode_sequence_data(
            xorname,
            type_tag,
            SafeContentType::Raw,
            self.xorurl_base,
            private,
        )
    }
/// Create a Public Sequence on the network
///
/// ## Example
/// ```
/// # use sn_api::Safe;
/// # let mut safe = Safe::default();
/// # async_std::task::block_on(async {
/// #   safe.connect("", Some("fake-credentials")).await.unwrap();
///     let data = b"First in the sequence";
///     let xorurl = safe.sequence_create(data, None, 20_000, false).await.unwrap();
///     let received_data = safe.sequence_get(&xorurl).await.unwrap();
///     assert_eq!(received_data, (0, data.to_vec()));
/// # });
/// ```
Create a Public Sequence on the network
Create a Public Sequence on the network
pub async fn sequence_create(
        &mut self,
        data: &[u8],
        name: Option<XorName>,
        type_tag: u64,
        private: bool,
    ) -> Result<XorUrl> {
        let xorname = self
            .safe_client
            .store_sequence(data, name, type_tag, None, private)
            .await?;
        SafeUrl::encode_sequence_data(
            xorname,
            type_tag,
            SafeContentType::Raw,
            self.xorurl_base,
            private,
        )
    }
pub async fn sequence_create ( & mut self , data : & [ u8 ] , name : Option < XorName > , type_tag : u64 , private : bool , ) -> Result < XorUrl > { let xorname = self . safe_client . store_sequence ( data , name , type_tag , None , private ) . await ? ; SafeUrl :: encode_sequence_data ( xorname , type_tag , SafeContentType :: Raw , self . xorurl_base , private , ) }
Create a Public Sequence on the network
Create a Public Sequence on the network
&mut self
data
&[u8]
name
Option<XorName>
type_tag
u64
private
bool
example
None
use sn_api::safe;
None
let mut safe = safe::default();
None
async_std::task::block_on(async {
None
safe.connect("", some("fake-credentials")).await.unwrap();
let data = b"First in the sequence";
let xorurl = safe.sequence_create(data, None, 20_000, false).await.unwrap();
let received_data = safe.sequence_get(&xorurl).await.unwrap();
assert_eq!(received_data, (0, data.to_vec())).
let data = b " First in the sequence " ; let xorurl = safe . sequence_create ( data None 20_000 false ) . await . unwrap () ; let received_data = safe . sequence_get ( &xorurl ) . await . unwrap () ; assert_eq! ( received_data ( 0 data . to_vec () )) .
});
None