Skip to main content

PageBlobClient

Struct PageBlobClient 

Source
pub struct PageBlobClient { /* private fields */ }

Implementations§

Source§

impl PageBlobClient

Source

pub fn new( blob_url: Url, credential: Option<Arc<dyn TokenCredential>>, options: Option<PageBlobClientOptions>, ) -> Result<Self>

Creates a new PageBlobClient from a blob URL.

§Arguments
  • blob_url - The full URL of the Page blob, for example https://myaccount.blob.core.windows.net/mycontainer/myblob. The caller is responsible for percent-encoding the URL correctly; it will be used as-is.
  • credential - An optional implementation of TokenCredential that can provide an Entra ID token to use when authenticating.
  • options - Optional configuration for the client.
Source

pub fn url(&self) -> &Url

Gets the URL of the blob.

Source§

impl PageBlobClient

Source

pub async fn clear_pages( &self, range: HttpRange, options: Option<PageBlobClientClearPagesOptions<'_>>, ) -> Result<Response<PageBlobClientClearPagesResult, NoFormat>>

Clears a range of pages from the specified page blob.

§Arguments
  • range - Specifies the range of the blob to operate on.
  • options - Optional parameters for the request.
§Response Headers

The returned Response implements the PageBlobClientClearPagesResultHeaders trait, which provides access to response headers. For example:

use azure_core::{Result, http::{Response, NoFormat}};
use azure_storage_blob::models::{PageBlobClientClearPagesResult, PageBlobClientClearPagesResultHeaders};
async fn example() -> Result<()> {
    let response: Response<PageBlobClientClearPagesResult, NoFormat> = unimplemented!();
    // Access response headers
    if let Some(content_md5) = response.content_md5()? {
        println!("content-md5: {:?}", content_md5);
    }
    if let Some(etag) = response.etag()? {
        println!("etag: {:?}", etag);
    }
    if let Some(last_modified) = response.last_modified()? {
        println!("last-modified: {:?}", last_modified);
    }
    Ok(())
}
§Available headers
Source

pub async fn create( &self, size: u64, options: Option<PageBlobClientCreateOptions<'_>>, ) -> Result<Response<PageBlobClientCreateResult, NoFormat>>

Creates a new page blob.

§Arguments
  • size - The maximum size for the page blob. Must be aligned to a 512-byte boundary.
  • options - Optional parameters for the request.
§Response Headers

The returned Response implements the PageBlobClientCreateResultHeaders trait, which provides access to response headers. For example:

use azure_core::{Result, http::{Response, NoFormat}};
use azure_storage_blob::models::{PageBlobClientCreateResult, PageBlobClientCreateResultHeaders};
async fn example() -> Result<()> {
    let response: Response<PageBlobClientCreateResult, NoFormat> = unimplemented!();
    // Access response headers
    if let Some(content_md5) = response.content_md5()? {
        println!("content-md5: {:?}", content_md5);
    }
    if let Some(etag) = response.etag()? {
        println!("etag: {:?}", etag);
    }
    if let Some(last_modified) = response.last_modified()? {
        println!("last-modified: {:?}", last_modified);
    }
    Ok(())
}
§Available headers
Source

pub fn list_page_ranges( &self, options: Option<PageBlobClientListPageRangesOptions<'_>>, ) -> Result<PageIterator<Response<PageList, XmlFormat>>>

Returns the list of valid page ranges for the specified page blob.

§Arguments
  • options - Optional parameters for the request.
§Response Headers

The returned Response implements the PageListHeaders trait, which provides access to response headers. For example:

use azure_core::{Result, http::{Response, XmlFormat}};
use azure_storage_blob::models::{PageList, PageListHeaders};
async fn example() -> Result<()> {
    let response: Response<PageList, XmlFormat> = unimplemented!();
    // Access response headers
    if let Some(etag) = response.etag()? {
        println!("etag: {:?}", etag);
    }
    if let Some(last_modified) = response.last_modified()? {
        println!("last-modified: {:?}", last_modified);
    }
    if let Some(blob_content_length) = response.blob_content_length()? {
        println!("x-ms-blob-content-length: {:?}", blob_content_length);
    }
    Ok(())
}
§Available headers
Source

pub async fn resize( &self, size: u64, options: Option<PageBlobClientResizeOptions<'_>>, ) -> Result<Response<PageBlobClientResizeResult, NoFormat>>

Changes the size of the specified page blob.

§Arguments
  • size - The maximum size for the page blob. Must be aligned to a 512-byte boundary.
  • options - Optional parameters for the request.
§Response Headers

The returned Response implements the PageBlobClientResizeResultHeaders trait, which provides access to response headers. For example:

use azure_core::{Result, http::{Response, NoFormat}};
use azure_storage_blob::models::{PageBlobClientResizeResult, PageBlobClientResizeResultHeaders};
async fn example() -> Result<()> {
    let response: Response<PageBlobClientResizeResult, NoFormat> = unimplemented!();
    // Access response headers
    if let Some(etag) = response.etag()? {
        println!("etag: {:?}", etag);
    }
    if let Some(last_modified) = response.last_modified()? {
        println!("last-modified: {:?}", last_modified);
    }
    if let Some(blob_sequence_number) = response.blob_sequence_number()? {
        println!("x-ms-blob-sequence-number: {:?}", blob_sequence_number);
    }
    Ok(())
}
§Available headers
Source

pub async fn set_sequence_number( &self, sequence_number_action: SequenceNumberActionType, options: Option<PageBlobClientSetSequenceNumberOptions<'_>>, ) -> Result<Response<PageBlobClientSetSequenceNumberResult, NoFormat>>

Updates the sequence number of the specified page blob. The operation will fail if the specified sequence number is less than the current sequence number of the blob.

§Arguments
  • sequence_number_action - Required if the blob sequence number is provided. This property indicates how the service should modify the blob’s sequence number.
  • options - Optional parameters for the request.
§Response Headers

The returned Response implements the PageBlobClientSetSequenceNumberResultHeaders trait, which provides access to response headers. For example:

use azure_core::{Result, http::{Response, NoFormat}};
use azure_storage_blob::models::{PageBlobClientSetSequenceNumberResult, PageBlobClientSetSequenceNumberResultHeaders};
async fn example() -> Result<()> {
    let response: Response<PageBlobClientSetSequenceNumberResult, NoFormat> = unimplemented!();
    // Access response headers
    if let Some(etag) = response.etag()? {
        println!("etag: {:?}", etag);
    }
    if let Some(last_modified) = response.last_modified()? {
        println!("last-modified: {:?}", last_modified);
    }
    if let Some(blob_sequence_number) = response.blob_sequence_number()? {
        println!("x-ms-blob-sequence-number: {:?}", blob_sequence_number);
    }
    Ok(())
}
§Available headers
Source

pub async fn upload_pages( &self, body: RequestContent<Bytes, NoFormat>, content_length: u64, range: HttpRange, options: Option<PageBlobClientUploadPagesOptions<'_>>, ) -> Result<Response<PageBlobClientUploadPagesResult, NoFormat>>

Writes a range of pages to the specified page blob.

§Arguments
  • body - The body of the request.
  • content_length - The length of the request.
  • range - Specifies the range of the blob to operate on.
  • options - Optional parameters for the request.
§Response Headers

The returned Response implements the PageBlobClientUploadPagesResultHeaders trait, which provides access to response headers. For example:

use azure_core::{Result, http::{Response, NoFormat}};
use azure_storage_blob::models::{PageBlobClientUploadPagesResult, PageBlobClientUploadPagesResultHeaders};
async fn example() -> Result<()> {
    let response: Response<PageBlobClientUploadPagesResult, NoFormat> = unimplemented!();
    // Access response headers
    if let Some(content_md5) = response.content_md5()? {
        println!("content-md5: {:?}", content_md5);
    }
    if let Some(etag) = response.etag()? {
        println!("etag: {:?}", etag);
    }
    if let Some(last_modified) = response.last_modified()? {
        println!("last-modified: {:?}", last_modified);
    }
    Ok(())
}
§Available headers
Source

pub async fn upload_pages_from_url( &self, source_url: String, source_range: HttpRange, content_length: u64, range: HttpRange, options: Option<PageBlobClientUploadPagesFromUrlOptions<'_>>, ) -> Result<Response<PageBlobClientUploadPagesFromUrlResult, NoFormat>>

Writes a range of pages to the specified page blob where the contents are read from a URL.

§Arguments
  • source_url - Specifies the URL of the source.
  • source_range - Specifies the bytes of the source.
  • content_length - The length of the request.
  • range - Specifies the range of the blob to operate on.
  • options - Optional parameters for the request.
§Response Headers

The returned Response implements the PageBlobClientUploadPagesFromUrlResultHeaders trait, which provides access to response headers. For example:

use azure_core::{Result, http::{Response, NoFormat}};
use azure_storage_blob::models::{PageBlobClientUploadPagesFromUrlResult, PageBlobClientUploadPagesFromUrlResultHeaders};
async fn example() -> Result<()> {
    let response: Response<PageBlobClientUploadPagesFromUrlResult, NoFormat> = unimplemented!();
    // Access response headers
    if let Some(content_md5) = response.content_md5()? {
        println!("content-md5: {:?}", content_md5);
    }
    if let Some(etag) = response.etag()? {
        println!("etag: {:?}", etag);
    }
    if let Some(last_modified) = response.last_modified()? {
        println!("last-modified: {:?}", last_modified);
    }
    Ok(())
}
§Available headers

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ServiceExt for T

Source§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
Source§

fn decompression(self) -> Decompression<Self>
where Self: Sized,

Decompress response bodies. Read more
Source§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
Source§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
Source§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more