[−][src]Struct atomic_lib::resources::Resource
A resource is a set of Atoms that shares a single Subject
Implementations
impl<'a> Resource<'a>
[src]
pub fn new(subject: String, store: &'a dyn Storelike) -> Resource<'a>
[src]
Create a new, empty Resource.
pub fn new_from_resource_string(
subject: String,
resource_string: &ResourceString,
store: &'a dyn Storelike
) -> AtomicResult<Resource<'a>>
[src]
subject: String,
resource_string: &ResourceString,
store: &'a dyn Storelike
) -> AtomicResult<Resource<'a>>
pub fn get(&self, property_url: &str) -> AtomicResult<&Value>
[src]
Get a value by property URL
pub fn get_shortname(&self, shortname: &str) -> AtomicResult<&Value>
[src]
Gets a value by its shortname
pub fn get_classes(&mut self) -> AtomicResult<Vec<Class>>
[src]
Checks if the classes are there, if not, fetches them
pub fn resolve_shortname(
&mut self,
shortname: &str
) -> AtomicResult<Option<Property>>
[src]
&mut self,
shortname: &str
) -> AtomicResult<Option<Property>>
Tries to resolve the shortname to a URL.
pub fn insert_string(
&mut self,
property_url: String,
value: &str
) -> AtomicResult<()>
[src]
&mut self,
property_url: String,
value: &str
) -> AtomicResult<()>
Insert a Property/Value combination. Overwrites existing Property/Value. Validates the datatype.
pub fn insert(&mut self, property: String, value: Value) -> AtomicResult<()>
[src]
Inserts a Property/Value combination. Overwrites existing.
pub fn set_prop(&mut self, property: &str, value: &str) -> AtomicResult<()>
[src]
Sets a property / value combination. Property can be a shortname (e.g. 'description' instead of the full URL), if the Resource has a Class. Validates the datatype.
pub fn set_subject(&mut self, url: String)
[src]
pub fn subject(&self) -> &String
[src]
pub fn to_plain(&self) -> HashMap<String, String>
[src]
Converts a resource to a string only HashMap
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Resource<'a>
impl<'a> !Send for Resource<'a>
impl<'a> !Sync for Resource<'a>
impl<'a> Unpin for Resource<'a>
impl<'a> !UnwindSafe for Resource<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,