pub struct CosMapItem {
pub host: String,
pub port: u16,
pub region: Option<String>,
pub api_key: Option<String>,
pub access_key: Option<String>,
pub secret_key: Option<String>,
pub ttl: Option<u64>,
pub tls: Option<bool>,
pub addressing_style: Option<String>,
}Expand description
Represents a COS map item with its properties.
This struct is used to store the configuration for a COS bucket. Each bucket is identified by its name, and the properties include:
host: The host address of the COS service.port: The port number for the COS service.region: The region where the COS service is located.api_key: The API key for accessing the COS service (optional).access_key: The access key for the COS service (optional).secret_key: The secret key for the COS service (optional).ttl: The time-to-live for the COS bucket (optional).
Fields§
§host: String§port: u16§region: Option<String>§api_key: Option<String>§access_key: Option<String>§secret_key: Option<String>§ttl: Option<u64>§tls: Option<bool>§addressing_style: Option<String>Implementations§
Source§impl CosMapItem
impl CosMapItem
Sourcepub fn has_api_key(&self) -> bool
pub fn has_api_key(&self) -> bool
Returns true if an API‑key is present.
Sourcepub async fn ensure_credentials<F, Fut>(
&mut self,
bucket: &str,
fetcher: Option<F>,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn ensure_credentials<F, Fut>( &mut self, bucket: &str, fetcher: Option<F>, ) -> Result<(), Box<dyn Error + Send + Sync>>
Ensure that some credential (HMAC or API key) is populated.
- If HMAC pair exists → OK
- Else if api_key exists → OK
- Else it calls the supplied async
fetcher(bucket)which should return one of the accepted formats (seeBucketCredential). The struct is then updated in‑place.
Trait Implementations§
Source§impl Clone for CosMapItem
impl Clone for CosMapItem
Source§fn clone(&self) -> CosMapItem
fn clone(&self) -> CosMapItem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CosMapItem
impl Debug for CosMapItem
Source§impl<'py> IntoPyObject<'py> for CosMapItem
impl<'py> IntoPyObject<'py> for CosMapItem
Source§type Target = CosMapItem
type Target = CosMapItem
The Python output type
Source§type Output = Bound<'py, <CosMapItem as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <CosMapItem as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl PyClass for CosMapItem
impl PyClass for CosMapItem
Source§impl PyClassImpl for CosMapItem
impl PyClassImpl for CosMapItem
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§type ThreadChecker = SendablePyClass<CosMapItem>
type ThreadChecker = SendablePyClass<CosMapItem>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a CosMapItem
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a CosMapItem
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut CosMapItem
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut CosMapItem
Source§impl PyTypeInfo for CosMapItem
impl PyTypeInfo for CosMapItem
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type.impl DerefToPyAny for CosMapItem
Auto Trait Implementations§
impl Freeze for CosMapItem
impl RefUnwindSafe for CosMapItem
impl Send for CosMapItem
impl Sync for CosMapItem
impl Unpin for CosMapItem
impl UnsafeUnpin for CosMapItem
impl UnwindSafe for CosMapItem
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
§fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
Converts
self into a Python object. Read more