OwnedMemberAccessor
- class OwnedMemberAccessor[R: OwningMembership, M: Element]
-
Children
Members defined in
OwnedMemberAccessor(2 members)
Constructs a new
member_elementwith the default type if thismemberis empty, otherwise does nothing.
Set a new owned
member_element, ownership constraints apply. Replaces the previousmember_element, which may be reused by the model.name_idhas no effect since theelementis always taken ownership of.Members inherited from
MemberAccessor(5 members)
RThe
member_elementof thismemberif it is not empty.
RThe
membershipof thismemberif it is not empty.
Extract the
member_elementleaving thismemberempty. Note that not all emptymembersare valid textual syntax. This does not check that the model is left in a valid state.
Remove the
member_elementleaving thismemberempty. Note that not all emptymembersare valid textual syntax. This does not check that the model is left in a valid state. Methods
- add_member_element() tuple[syside.R, syside.M]
Constructs a new
member_elementwith the default type if thismemberis empty, otherwise does nothing.Returns a pair of (
membership,member_element)
- set_member_element(element: syside.M, name: syside.NameID = ...) tuple[syside.R, syside.M]
Set a new owned
member_element, ownership constraints apply. Replaces the previousmember_element, which may be reused by the model.name_idhas no effect since theelementis always taken ownership of.Returns a pair of (
membership,member_element) wheremember_elementiselement.
- set_member_element(element: syside.M | None, name: syside.NameID = ...) tuple[syside.R, syside.M] | None
set_member_elementoverload that will remove the member element ifelementisNone, otherwise the behaviour is the same.
- set_member_element(arg: type[syside.M], /) tuple[syside.R, syside.M]
Constructs a new empty
member_elementwith the provided type. Replaces the previousmember_element. Because a new element is always constructed, ownership constraints do not apply.Returns a pair of (
membership,member_element).