pub(crate) async fn fetch_sequence(&mut self, safe_url: &SafeUrl) -> Result<(u64, Vec<u8>)> {
        let is_private = safe_url.data_type() == SafeDataType::PrivateSequence;
        let data = match safe_url.content_version() {
            Some(version) => {
                // We fetch a specific entry since the URL specifies a specific version
                let data = self
                    .safe_client
                    .sequence_get_entry(
                        safe_url.xorname(),
                        safe_url.type_tag(),
                        version,
                        is_private,
                    )
                    .await?;

                Ok((version, data))
            }
            None => {
                // ...then get last entry in the Sequence
                self.safe_client
                    .sequence_get_last_entry(safe_url.xorname(), safe_url.type_tag(), is_private)
                    .await
            }
        };

        match data {
            Ok((version, value)) => {
                debug!("Sequence retrieved... v{}", &version);
                Ok((version, value))
            }
            Err(Error::EmptyContent(_)) => Err(Error::EmptyContent(format!(
                "Sequence found at \"{}\" was empty",
                safe_url
            ))),
            Err(Error::ContentNotFound(_)) => Err(Error::ContentNotFound(
                "No Sequence found at this address".to_string(),
            )),
            other => other,
        }
    }
/// Fetch a Sequence from a SafeUrl without performing any type of URL resolution
Fetch a Sequence from a SafeUrl without performing any type of URL resolution
Fetch a Sequence from a SafeUrl without performing any type of URL resolution
pub(crate) async fn fetch_sequence(&mut self, safe_url: &SafeUrl) -> Result<(u64, Vec<u8>)> {
        let is_private = safe_url.data_type() == SafeDataType::PrivateSequence;
        let data = match safe_url.content_version() {
            Some(version) => {
                // We fetch a specific entry since the URL specifies a specific version
                let data = self
                    .safe_client
                    .sequence_get_entry(
                        safe_url.xorname(),
                        safe_url.type_tag(),
                        version,
                        is_private,
                    )
                    .await?;
                Ok((version, data))
            }
            None => {
                // ...then get last entry in the Sequence
                self.safe_client
                    .sequence_get_last_entry(safe_url.xorname(), safe_url.type_tag(), is_private)
                    .await
            }
        };
        match data {
            Ok((version, value)) => {
                debug!("Sequence retrieved... v{}", &version);
                Ok((version, value))
            }
            Err(Error::EmptyContent(_)) => Err(Error::EmptyContent(format!(
                "Sequence found at \"{}\" was empty",
                safe_url
            ))),
            Err(Error::ContentNotFound(_)) => Err(Error::ContentNotFound(
                "No Sequence found at this address".to_string(),
            )),
            other => other,
        }
    }
pub ( crate ) async fn fetch_sequence ( & mut self , safe_url : & SafeUrl ) -> Result < ( u64 , Vec < u8 > ) > { let is_private = safe_url . data_type ( ) == SafeDataType :: PrivateSequence ; let data = match safe_url . content_version ( ) { Some ( version ) => { // We fetch a specific entry since the URL specifies a specific version let data = self . safe_client . sequence_get_entry ( safe_url . xorname ( ) , safe_url . type_tag ( ) , version , is_private , ) . await ? ; Ok ( ( version , data ) ) } None => { // ...then get last entry in the Sequence self . safe_client . sequence_get_last_entry ( safe_url . xorname ( ) , safe_url . type_tag ( ) , is_private ) . await } } ; match data { Ok ( ( version , value ) ) => { debug ! ( " " version ) ; Ok ( ( version , value ) ) } Err ( Error :: EmptyContent ( _ ) ) => Err ( Error :: EmptyContent ( format ! ( " \" \" " safe_url ) ) ) , Err ( Error :: ContentNotFound ( _ ) ) => Err ( Error :: ContentNotFound ( " " . to_string ( ) , ) ) , other => other , } }
Fetch a Sequence from a SafeUrl without performing any type of URL resolution
Fetch a Sequence from a SafeUrl without performing any type of URL resolution
&mut self
safe_url
&SafeUrl