pub struct ECS { /* private fields */ }
Implementations§
Source§impl ECS
impl ECS
pub fn new( source_prefix_length: u8, scope_prefix_length: u8, address: Address, ) -> Result<ECS, AddressError>
Sourcepub const fn get_source_prefix_length(&self) -> u8
pub const fn get_source_prefix_length(&self) -> u8
Returns the current source prefix length.
Sourcepub fn set_source_prefix_length(
&mut self,
new_value: u8,
) -> Result<(), AddressError>
pub fn set_source_prefix_length( &mut self, new_value: u8, ) -> Result<(), AddressError>
Try to set the source prefix length.
Returns Ok()
if the length fit in the current address as network mask, otherwise
returns AddressError
and the value is not changed.
Sourcepub const fn get_scope_prefix_length(&self) -> u8
pub const fn get_scope_prefix_length(&self) -> u8
Returns the current scope prefix length.
Sourcepub fn set_scope_prefix_length(
&mut self,
new_value: u8,
) -> Result<(), AddressError>
pub fn set_scope_prefix_length( &mut self, new_value: u8, ) -> Result<(), AddressError>
Try to set the scope prefix length.
Returns Ok()
if the length fit in the current address as network mask, otherwise
returns AddressError
and the value is not changed.
Sourcepub const fn get_address(&self) -> &Address
pub const fn get_address(&self) -> &Address
Returns the current address.
Sourcepub fn set_address(&mut self, new_value: Address) -> Result<(), AddressError>
pub fn set_address(&mut self, new_value: Address) -> Result<(), AddressError>
Try to set the scope prefix length.
Returns Ok()
if the current and scope prefix length fits in the new address as
network mask , otherwise returns AddressError
and the value is not changed.
Sourcepub fn get_prefix_length(&self) -> u8
pub fn get_prefix_length(&self) -> u8
Returns the prefix length of the address.
It the max value of the source_prefix_length
and scope_prefix_length
.
Trait Implementations§
impl Eq for ECS
impl StructuralPartialEq for ECS
Auto Trait Implementations§
impl Freeze for ECS
impl RefUnwindSafe for ECS
impl Send for ECS
impl Sync for ECS
impl Unpin for ECS
impl UnwindSafe for ECS
Blanket Implementations§
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